@proximus/lavender-selectablebox 1.0.0-alpha.10
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/SelectableBox.d.ts +13 -0
- package/dist/SelectableBoxCheckbox.d.ts +39 -0
- package/dist/SelectableBoxRadio.d.ts +39 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.es.js +992 -0
- package/package.json +20 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { WithExtraAttributes } from '@proximus/lavender-common';
|
|
2
|
+
import '@proximus/lavender-layout';
|
|
3
|
+
export declare class SelectableBox extends WithExtraAttributes {
|
|
4
|
+
protected template(): string;
|
|
5
|
+
constructor();
|
|
6
|
+
static get observedAttributes(): string[];
|
|
7
|
+
attributeChangedCallback(attrName: string, oldValue: string, newValue: string): void;
|
|
8
|
+
get $el(): HTMLElement;
|
|
9
|
+
get inverted(): boolean;
|
|
10
|
+
set inverted(value: boolean);
|
|
11
|
+
get hideFooter(): boolean;
|
|
12
|
+
set hideFooter(value: boolean);
|
|
13
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { WithExtraAttributes } from '@proximus/lavender-common';
|
|
2
|
+
import '@proximus/lavender-layout';
|
|
3
|
+
import { SelectableBox } from './SelectableBox';
|
|
4
|
+
import { type Checkbox } from '@proximus/lavender-checkbox';
|
|
5
|
+
export declare class SelectableBoxCheckbox extends WithExtraAttributes {
|
|
6
|
+
protected internals: ElementInternals;
|
|
7
|
+
protected template(): string;
|
|
8
|
+
constructor();
|
|
9
|
+
connectedCallback(): void;
|
|
10
|
+
static get observedAttributes(): string[];
|
|
11
|
+
attributeChangedCallback(attrName: string, oldValue: string, newValue: string): void;
|
|
12
|
+
disconnectedCallback(): void;
|
|
13
|
+
private removeHoverAttribute;
|
|
14
|
+
private setHoverAttribute;
|
|
15
|
+
private setKeypressEvent;
|
|
16
|
+
private setClickEvent;
|
|
17
|
+
toggleFooterVisibility(): void;
|
|
18
|
+
handleDisabledAttributeChange(disabled: boolean): void;
|
|
19
|
+
handleCheckedAttributeChange(newValue: string): void;
|
|
20
|
+
static get formAssociated(): boolean;
|
|
21
|
+
formResetCallback(): void;
|
|
22
|
+
formStateRestoreCallback(state: any): void;
|
|
23
|
+
formData(): FormData;
|
|
24
|
+
get $el(): HTMLElement;
|
|
25
|
+
get $selectableBox(): SelectableBox;
|
|
26
|
+
get $checkbox(): Checkbox;
|
|
27
|
+
get $slotFooter(): HTMLSlotElement;
|
|
28
|
+
get $slottedFooter(): HTMLElement;
|
|
29
|
+
get inverted(): boolean;
|
|
30
|
+
set inverted(value: boolean);
|
|
31
|
+
get checked(): boolean;
|
|
32
|
+
set checked(value: boolean);
|
|
33
|
+
get name(): string;
|
|
34
|
+
set name(value: string);
|
|
35
|
+
get disabled(): boolean;
|
|
36
|
+
set disabled(value: boolean);
|
|
37
|
+
get value(): string;
|
|
38
|
+
set value(value: string);
|
|
39
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { WithExtraAttributes } from '@proximus/lavender-common';
|
|
2
|
+
import '@proximus/lavender-layout';
|
|
3
|
+
import { SelectableBox } from './SelectableBox';
|
|
4
|
+
import { type RadioBase } from '@proximus/lavender-radio-group';
|
|
5
|
+
export declare class SelectableBoxRadio extends WithExtraAttributes {
|
|
6
|
+
protected internals: ElementInternals;
|
|
7
|
+
protected template(): string;
|
|
8
|
+
constructor();
|
|
9
|
+
connectedCallback(): void;
|
|
10
|
+
static get observedAttributes(): string[];
|
|
11
|
+
attributeChangedCallback(attrName: string, oldValue: string, newValue: string): void;
|
|
12
|
+
disconnectedCallback(): void;
|
|
13
|
+
private removeHoverAttribute;
|
|
14
|
+
private setHoverAttribute;
|
|
15
|
+
private setKeypressEvent;
|
|
16
|
+
private setClickEvent;
|
|
17
|
+
toggleFooterVisibility(): void;
|
|
18
|
+
handleDisabledAttributeChange(disabled: boolean): void;
|
|
19
|
+
handleCheckedAttributeChange(newValue: string): void;
|
|
20
|
+
static get formAssociated(): boolean;
|
|
21
|
+
formResetCallback(): void;
|
|
22
|
+
formStateRestoreCallback(state: any): void;
|
|
23
|
+
formData(): FormData;
|
|
24
|
+
get $el(): HTMLElement;
|
|
25
|
+
get $selectableBox(): SelectableBox;
|
|
26
|
+
get $radio(): RadioBase;
|
|
27
|
+
get $slotFooter(): HTMLSlotElement;
|
|
28
|
+
get $slottedFooter(): HTMLElement;
|
|
29
|
+
get inverted(): boolean;
|
|
30
|
+
set inverted(value: boolean);
|
|
31
|
+
get checked(): boolean;
|
|
32
|
+
set checked(value: boolean);
|
|
33
|
+
get name(): string;
|
|
34
|
+
set name(value: string);
|
|
35
|
+
get disabled(): boolean;
|
|
36
|
+
set disabled(value: boolean);
|
|
37
|
+
get value(): string;
|
|
38
|
+
set value(value: string);
|
|
39
|
+
}
|
package/dist/index.d.ts
ADDED
package/dist/index.es.js
ADDED
|
@@ -0,0 +1,992 @@
|
|
|
1
|
+
import { WithExtraAttributes as n, AttributeBreakpointHandlerDelegate as f, gapValues as v, checkName as m, backgroundColorValues as k } from "@proximus/lavender-common";
|
|
2
|
+
const A = ':host{display:block}:host([overflow-x="auto"]){margin:calc(calc(var(--px-focus-outline-mobile) + var(--px-focus-offset-mobile)) * -1)}:host([overflow-x="auto"]) .flex-container{padding:calc(var(--px-focus-outline-mobile) + var(--px-focus-offset-mobile))}.flex-container{display:flex;height:100%;width:100%;box-sizing:border-box;flex-direction:var(--flex-direction--mobile-value);gap:var(--flex-gap--mobile-value);flex-wrap:var(--flex-wrap--mobile-value);justify-content:var(--flex-justify-content--mobile-value);align-items:var(--flex-align-items--mobile-value);overflow-x:var(--overflow-x-all)}@media only screen and (max-width: 47.9375em){.flex-container{overflow-x:var(--overflow-x-all-mobile, var(--overflow-x-all));scrollbar-width:none}.flex-container::-webkit-scrollbar{display:none}}@media only screen and (min-width: 48em){.flex-container{flex-direction:var(--flex-direction--tablet-value);gap:var(--flex-gap--tablet-value);flex-wrap:var(--flex-wrap--tablet-value);justify-content:var(--flex-justify-content--tablet-value);align-items:var(--flex-align-items--tablet-value)}:host([overflow-x="auto"]){margin:calc(calc(var(--px-focus-outline-tablet) + var(--px-focus-offset-tablet)) * -1)}:host([overflow-x="auto"]) .flex-container{padding:calc(var(--px-focus-outline-tablet) + var(--px-focus-offset-tablet))}}@media only screen and (min-width: 48em) and (max-width: 64em){.flex-container{overflow-x:var(--overflow-x-all-tablet, var(--overflow-x-all));scrollbar-width:none}.flex-container::-webkit-scrollbar{display:none}}@media only screen and (min-width: 64.0625em){.flex-container{flex-direction:var(--flex-direction--laptop-value);gap:var(--flex-gap--laptop-value);flex-wrap:var(--flex-wrap--laptop-value);justify-content:var(--flex-justify-content--laptop-value);align-items:var(--flex-align-items--laptop-value)}:host([overflow-x="auto"]){margin:calc(calc(var(--px-focus-outline-laptop) + var(--px-focus-offset-laptop)) * -1)}:host([overflow-x="auto"]) .flex-container{padding:calc(var(--px-focus-outline-laptop) + var(--px-focus-offset-laptop))}}@media only screen and (min-width: 64.0625em) and (max-width: 90em){.flex-container{overflow-x:var(--overflow-x-all-laptop, var(--overflow-x-all))}}@media only screen and (min-width: 90.0625em){.flex-container{flex-direction:var(--flex-direction--desktop-value);gap:var(--flex-gap--desktop-value);flex-wrap:var(--flex-wrap--desktop-value);justify-content:var(--flex-justify-content--desktop-value);align-items:var(--flex-align-items--desktop-value);overflow-x:var(--overflow-x-all-desktop, var(--overflow-x-all))}:host([overflow-x="auto"]){margin:calc(calc(var(--px-focus-outline-desktop) + var(--px-focus-offset-desktop)) * -1)}:host([overflow-x="auto"]) .flex-container{padding:calc(var(--px-focus-outline-desktop) + var(--px-focus-offset-desktop))}}', b = new CSSStyleSheet();
|
|
3
|
+
b.replaceSync(A);
|
|
4
|
+
const y = [
|
|
5
|
+
"",
|
|
6
|
+
"default",
|
|
7
|
+
"row",
|
|
8
|
+
"row-reverse",
|
|
9
|
+
"column",
|
|
10
|
+
"column-reverse"
|
|
11
|
+
], w = [
|
|
12
|
+
"",
|
|
13
|
+
"default",
|
|
14
|
+
"stretch",
|
|
15
|
+
"flex-start",
|
|
16
|
+
"flex-end",
|
|
17
|
+
"center",
|
|
18
|
+
"baseline"
|
|
19
|
+
], $ = [
|
|
20
|
+
"",
|
|
21
|
+
"default",
|
|
22
|
+
"flex-start",
|
|
23
|
+
"flex-end",
|
|
24
|
+
"center",
|
|
25
|
+
"space-between",
|
|
26
|
+
"space-around",
|
|
27
|
+
"space-evenly"
|
|
28
|
+
], C = ["", "default", "nowrap", "wrap", "wrap-reverse"], S = ["", "visible", "hidden", "scroll", "auto"];
|
|
29
|
+
class c extends n {
|
|
30
|
+
constructor() {
|
|
31
|
+
super(b), this.overflowXAttributeDelegate = new f(
|
|
32
|
+
this,
|
|
33
|
+
"overflow-x",
|
|
34
|
+
(t) => t,
|
|
35
|
+
"--overflow-x"
|
|
36
|
+
), this.template = `<div class="flex-container">
|
|
37
|
+
<slot></slot>
|
|
38
|
+
</div>`, this.shadowRoot.innerHTML = this.template;
|
|
39
|
+
}
|
|
40
|
+
connectedCallback() {
|
|
41
|
+
this.hasAttribute("direction") || (this.direction = "row"), this.hasAttribute("gap") || (this.gap = "none"), this.hasAttribute("align-items") || (this.alignItems = "stretch"), this.hasAttribute("justify-content") || (this.justifyContent = "flex-start"), this.hasAttribute("wrap") || (this.wrap = "nowrap"), this.hasAttribute("overflow-x") || this.overflowXAttributeDelegate.init("visible");
|
|
42
|
+
}
|
|
43
|
+
static get observedAttributes() {
|
|
44
|
+
return [
|
|
45
|
+
...super.observedAttributes,
|
|
46
|
+
"direction",
|
|
47
|
+
"direction--mobile",
|
|
48
|
+
"direction--tablet",
|
|
49
|
+
"direction--laptop",
|
|
50
|
+
"direction--desktop",
|
|
51
|
+
"gap",
|
|
52
|
+
"gap--mobile",
|
|
53
|
+
"gap--tablet",
|
|
54
|
+
"gap--laptop",
|
|
55
|
+
"gap--desktop",
|
|
56
|
+
"justify-content",
|
|
57
|
+
"justify-content--mobile",
|
|
58
|
+
"justify-content--tablet",
|
|
59
|
+
"justify-content--laptop",
|
|
60
|
+
"justify-content--desktop",
|
|
61
|
+
"align-items",
|
|
62
|
+
"align-items--mobile",
|
|
63
|
+
"align-items--tablet",
|
|
64
|
+
"align-items--laptop",
|
|
65
|
+
"align-items--desktop",
|
|
66
|
+
"wrap",
|
|
67
|
+
"wrap--mobile",
|
|
68
|
+
"wrap--tablet",
|
|
69
|
+
"wrap--laptop",
|
|
70
|
+
"wrap--desktop",
|
|
71
|
+
"overflow-x",
|
|
72
|
+
"overflow-x--mobile",
|
|
73
|
+
"overflow-x--tablet",
|
|
74
|
+
"overflow-x--laptop",
|
|
75
|
+
"overflow-x--desktop"
|
|
76
|
+
];
|
|
77
|
+
}
|
|
78
|
+
attributeChangedCallback(t, e, i) {
|
|
79
|
+
switch (t) {
|
|
80
|
+
case "gap":
|
|
81
|
+
case "gap--mobile":
|
|
82
|
+
case "gap--tablet":
|
|
83
|
+
case "gap--laptop":
|
|
84
|
+
case "gap--desktop":
|
|
85
|
+
this.updateFlexProperties(t, e, i, v);
|
|
86
|
+
break;
|
|
87
|
+
case "justify-content":
|
|
88
|
+
case "justify-content--mobile":
|
|
89
|
+
case "justify-content--tablet":
|
|
90
|
+
case "justify-content--laptop":
|
|
91
|
+
case "justify-content--desktop":
|
|
92
|
+
this.updateFlexProperties(
|
|
93
|
+
t,
|
|
94
|
+
e,
|
|
95
|
+
i,
|
|
96
|
+
$
|
|
97
|
+
);
|
|
98
|
+
break;
|
|
99
|
+
case "align-items":
|
|
100
|
+
case "align-items--mobile":
|
|
101
|
+
case "align-items--tablet":
|
|
102
|
+
case "align-items--laptop":
|
|
103
|
+
case "align-items--desktop":
|
|
104
|
+
this.updateFlexProperties(t, e, i, w);
|
|
105
|
+
break;
|
|
106
|
+
case "wrap":
|
|
107
|
+
case "wrap--mobile":
|
|
108
|
+
case "wrap--tablet":
|
|
109
|
+
case "wrap--laptop":
|
|
110
|
+
case "wrap--desktop":
|
|
111
|
+
this.updateFlexProperties(t, e, i, C);
|
|
112
|
+
break;
|
|
113
|
+
case "direction":
|
|
114
|
+
case "direction--mobile":
|
|
115
|
+
case "direction--tablet":
|
|
116
|
+
case "direction--laptop":
|
|
117
|
+
case "direction--desktop":
|
|
118
|
+
this.updateFlexProperties(t, e, i, y);
|
|
119
|
+
break;
|
|
120
|
+
case "overflow-x":
|
|
121
|
+
case "overflow-x--mobile":
|
|
122
|
+
case "overflow-x--tablet":
|
|
123
|
+
case "overflow-x--laptop":
|
|
124
|
+
case "overflow-x--desktop":
|
|
125
|
+
this.updateOverflowX(t, e, i, S);
|
|
126
|
+
break;
|
|
127
|
+
default:
|
|
128
|
+
super.attributeChangedCallback(t, e, i);
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
updateOverflowX(t, e, i, o) {
|
|
133
|
+
if (!m(o, i)) {
|
|
134
|
+
console.error(`${i} is not an allowed ${t} value`);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
this.overflowXAttributeDelegate.attributeChangedCallback(
|
|
138
|
+
t,
|
|
139
|
+
e,
|
|
140
|
+
i
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
updateFlexProperties(t, e, i, o) {
|
|
144
|
+
this.checkName(o, i) || console.error(`${i} is not a valid value for ${o}`);
|
|
145
|
+
const d = t.indexOf("--") > -1, s = d ? t.split("--")[0] : t, a = [];
|
|
146
|
+
if (!d)
|
|
147
|
+
this.getAttribute(s + "--mobile") || a.push("mobile"), this.getAttribute(s + "--tablet") || a.push("tablet"), this.getAttribute(s + "--laptop") || a.push("laptop"), this.getAttribute(s + "--desktop") || a.push("desktop"), a.forEach((l) => {
|
|
148
|
+
this.updateStyle(s, l, e, o), this.updateStyle(s, l, i, o);
|
|
149
|
+
});
|
|
150
|
+
else {
|
|
151
|
+
const l = t.split("--")[1];
|
|
152
|
+
this.updateStyle(s, l, e, o), this.updateStyle(s, l, i, o);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
updateStyle(t, e, i, o) {
|
|
156
|
+
i && (t === "gap" && o && o.includes(i) ? this.$el.style.setProperty(
|
|
157
|
+
`--flex-${t}--${e}-value`,
|
|
158
|
+
`var(--px-spacing-${i}-${e === "laptop" ? "desktop" : e})`
|
|
159
|
+
) : this.$el.style.setProperty(
|
|
160
|
+
`--flex-${t}--${e}-value`,
|
|
161
|
+
i
|
|
162
|
+
));
|
|
163
|
+
}
|
|
164
|
+
get direction() {
|
|
165
|
+
return this.getAttribute("direction");
|
|
166
|
+
}
|
|
167
|
+
set direction(t) {
|
|
168
|
+
this.setAttribute("direction", t);
|
|
169
|
+
}
|
|
170
|
+
get directionMobile() {
|
|
171
|
+
return this.getAttribute("direction--mobile");
|
|
172
|
+
}
|
|
173
|
+
set directionMobile(t) {
|
|
174
|
+
this.setAttribute("direction--mobile", t);
|
|
175
|
+
}
|
|
176
|
+
get directionTablet() {
|
|
177
|
+
return this.getAttribute("direction--tablet");
|
|
178
|
+
}
|
|
179
|
+
set directionTablet(t) {
|
|
180
|
+
this.setAttribute("direction--tablet", t);
|
|
181
|
+
}
|
|
182
|
+
get directionLaptop() {
|
|
183
|
+
return this.getAttribute("direction--laptop");
|
|
184
|
+
}
|
|
185
|
+
set directionLaptop(t) {
|
|
186
|
+
this.setAttribute("direction--laptop", t);
|
|
187
|
+
}
|
|
188
|
+
get directionDesktop() {
|
|
189
|
+
return this.getAttribute("direction--desktop");
|
|
190
|
+
}
|
|
191
|
+
set directionDesktop(t) {
|
|
192
|
+
this.setAttribute("direction--desktop", t);
|
|
193
|
+
}
|
|
194
|
+
get gap() {
|
|
195
|
+
return this.getAttribute("gap");
|
|
196
|
+
}
|
|
197
|
+
set gap(t) {
|
|
198
|
+
this.setAttribute("gap", t);
|
|
199
|
+
}
|
|
200
|
+
get gapMobile() {
|
|
201
|
+
return this.getAttribute("gap--mobile");
|
|
202
|
+
}
|
|
203
|
+
set gapMobile(t) {
|
|
204
|
+
this.setAttribute("gap--mobile", t);
|
|
205
|
+
}
|
|
206
|
+
get gapTablet() {
|
|
207
|
+
return this.getAttribute("gap--tablet");
|
|
208
|
+
}
|
|
209
|
+
set gapTablet(t) {
|
|
210
|
+
this.setAttribute("gap--tablet", t);
|
|
211
|
+
}
|
|
212
|
+
get gapLaptop() {
|
|
213
|
+
return this.getAttribute("gap--laptop");
|
|
214
|
+
}
|
|
215
|
+
set gapLaptop(t) {
|
|
216
|
+
this.setAttribute("gap--laptop", t);
|
|
217
|
+
}
|
|
218
|
+
get gapDesktop() {
|
|
219
|
+
return this.getAttribute("gap--desktop");
|
|
220
|
+
}
|
|
221
|
+
set gapDesktop(t) {
|
|
222
|
+
this.setAttribute("gap--desktop", t);
|
|
223
|
+
}
|
|
224
|
+
get justifyContent() {
|
|
225
|
+
return this.getAttribute("justify-content");
|
|
226
|
+
}
|
|
227
|
+
set justifyContent(t) {
|
|
228
|
+
this.setAttribute("justify-content", t);
|
|
229
|
+
}
|
|
230
|
+
get justifyContentMobile() {
|
|
231
|
+
return this.getAttribute("justify-content--mobile");
|
|
232
|
+
}
|
|
233
|
+
set justifyContentMobile(t) {
|
|
234
|
+
this.setAttribute("justify-content--mobile", t);
|
|
235
|
+
}
|
|
236
|
+
get justifyContentTablet() {
|
|
237
|
+
return this.getAttribute("justify-content--tablet");
|
|
238
|
+
}
|
|
239
|
+
set justifyContentTablet(t) {
|
|
240
|
+
this.setAttribute("justify-content--tablet", t);
|
|
241
|
+
}
|
|
242
|
+
get justifyContentLaptop() {
|
|
243
|
+
return this.getAttribute("justify-content--laptop");
|
|
244
|
+
}
|
|
245
|
+
set justifyContentLaptop(t) {
|
|
246
|
+
this.setAttribute("justify-content--laptop", t);
|
|
247
|
+
}
|
|
248
|
+
get justifyContentDesktop() {
|
|
249
|
+
return this.getAttribute("justify-content--desktop");
|
|
250
|
+
}
|
|
251
|
+
set justifyContentDesktop(t) {
|
|
252
|
+
this.setAttribute("justify-content--desktop", t);
|
|
253
|
+
}
|
|
254
|
+
get alignItems() {
|
|
255
|
+
return this.getAttribute("align-items");
|
|
256
|
+
}
|
|
257
|
+
set alignItems(t) {
|
|
258
|
+
this.setAttribute("align-items", t);
|
|
259
|
+
}
|
|
260
|
+
get alignItemsMobile() {
|
|
261
|
+
return this.getAttribute("align-items--mobile");
|
|
262
|
+
}
|
|
263
|
+
set alignItemsMobile(t) {
|
|
264
|
+
this.setAttribute("align-items--mobile", t);
|
|
265
|
+
}
|
|
266
|
+
get alignItemsTablet() {
|
|
267
|
+
return this.getAttribute("align-items--tablet");
|
|
268
|
+
}
|
|
269
|
+
set alignItemsTablet(t) {
|
|
270
|
+
this.setAttribute("align-items--tablet", t);
|
|
271
|
+
}
|
|
272
|
+
get alignItemsLaptop() {
|
|
273
|
+
return this.getAttribute("align-items--laptop");
|
|
274
|
+
}
|
|
275
|
+
set alignItemsLaptop(t) {
|
|
276
|
+
this.setAttribute("align-items--laptop", t);
|
|
277
|
+
}
|
|
278
|
+
get alignItemsDesktop() {
|
|
279
|
+
return this.getAttribute("align-items--desktop");
|
|
280
|
+
}
|
|
281
|
+
set alignItemsDesktop(t) {
|
|
282
|
+
this.setAttribute("align-items--desktop", t);
|
|
283
|
+
}
|
|
284
|
+
get wrap() {
|
|
285
|
+
return this.getAttribute("wrap");
|
|
286
|
+
}
|
|
287
|
+
set wrap(t) {
|
|
288
|
+
this.setAttribute("wrap", t);
|
|
289
|
+
}
|
|
290
|
+
get wrapMobile() {
|
|
291
|
+
return this.getAttribute("wrap--mobile");
|
|
292
|
+
}
|
|
293
|
+
set wrapMobile(t) {
|
|
294
|
+
this.setAttribute("wrap--mobile", t);
|
|
295
|
+
}
|
|
296
|
+
get wrapTablet() {
|
|
297
|
+
return this.getAttribute("wrap--tablet");
|
|
298
|
+
}
|
|
299
|
+
set wrapTablet(t) {
|
|
300
|
+
this.setAttribute("wrap--tablet", t);
|
|
301
|
+
}
|
|
302
|
+
get wrapLaptop() {
|
|
303
|
+
return this.getAttribute("wrap--laptop");
|
|
304
|
+
}
|
|
305
|
+
set wrapLaptop(t) {
|
|
306
|
+
this.setAttribute("wrap--laptop", t);
|
|
307
|
+
}
|
|
308
|
+
get wrapDesktop() {
|
|
309
|
+
return this.getAttribute("wrap--desktop");
|
|
310
|
+
}
|
|
311
|
+
set wrapDesktop(t) {
|
|
312
|
+
this.setAttribute("wrap--desktop", t);
|
|
313
|
+
}
|
|
314
|
+
get overflowX() {
|
|
315
|
+
return this.getAttribute("overflow-x");
|
|
316
|
+
}
|
|
317
|
+
set overflowX(t) {
|
|
318
|
+
this.setAttribute("overflow-x", t);
|
|
319
|
+
}
|
|
320
|
+
get overflowXMobile() {
|
|
321
|
+
return this.getAttribute("overflow-x--mobile");
|
|
322
|
+
}
|
|
323
|
+
set overflowXMobile(t) {
|
|
324
|
+
this.setAttribute("overflow-x--mobile", t);
|
|
325
|
+
}
|
|
326
|
+
get overflowXTablet() {
|
|
327
|
+
return this.getAttribute("overflow-x--tablet");
|
|
328
|
+
}
|
|
329
|
+
set overflowXTablet(t) {
|
|
330
|
+
this.setAttribute("overflow-x--tablet", t);
|
|
331
|
+
}
|
|
332
|
+
get overflowXLaptop() {
|
|
333
|
+
return this.getAttribute("overflow-x--laptop");
|
|
334
|
+
}
|
|
335
|
+
set overflowXLaptop(t) {
|
|
336
|
+
this.setAttribute("overflow-x--laptop", t);
|
|
337
|
+
}
|
|
338
|
+
get overflowXDesktop() {
|
|
339
|
+
return this.getAttribute("overflow-x--desktop");
|
|
340
|
+
}
|
|
341
|
+
set overflowXDesktop(t) {
|
|
342
|
+
this.setAttribute("overflow-x--desktop", t);
|
|
343
|
+
}
|
|
344
|
+
get $el() {
|
|
345
|
+
return this.shadowRoot.querySelector(".flex-container");
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
customElements.get("px-stack") || customElements.define("px-stack", c);
|
|
349
|
+
class _ extends c {
|
|
350
|
+
constructor() {
|
|
351
|
+
super();
|
|
352
|
+
}
|
|
353
|
+
connectedCallback() {
|
|
354
|
+
super.connectedCallback(), this.direction = "column", this.directionMobile = "column", this.directionTablet = "column", this.directionLaptop = "column", this.directionDesktop = "column";
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
customElements.get("px-vstack") || customElements.define("px-vstack", _);
|
|
358
|
+
class E extends c {
|
|
359
|
+
constructor() {
|
|
360
|
+
super();
|
|
361
|
+
}
|
|
362
|
+
connectedCallback() {
|
|
363
|
+
super.connectedCallback(), this.direction = "row", this.directionMobile = "row", this.directionTablet = "row", this.directionLaptop = "row", this.directionDesktop = "row";
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
customElements.get("px-hstack") || customElements.define("px-hstack", E);
|
|
367
|
+
class L extends HTMLElement {
|
|
368
|
+
constructor() {
|
|
369
|
+
super();
|
|
370
|
+
}
|
|
371
|
+
static get observedAttributes() {
|
|
372
|
+
return ["grow"];
|
|
373
|
+
}
|
|
374
|
+
attributeChangedCallback(t, e, i) {
|
|
375
|
+
t === "grow" && (this.style.flexGrow = i);
|
|
376
|
+
}
|
|
377
|
+
connectedCallback() {
|
|
378
|
+
this.style.flexGrow = this.getAttribute("grow") || "1";
|
|
379
|
+
}
|
|
380
|
+
get grow() {
|
|
381
|
+
return this.getAttribute("grow");
|
|
382
|
+
}
|
|
383
|
+
set grow(t) {
|
|
384
|
+
this.setAttribute("grow", t);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
customElements.get("px-spacer") || customElements.define("px-spacer", L);
|
|
388
|
+
const j = ":host{display:block;box-sizing:border-box}slot[name=body-container]{min-height:100vh}#image-sticky-box{margin-top:-2.5em}", h = new CSSStyleSheet();
|
|
389
|
+
h.replaceSync(j);
|
|
390
|
+
class D extends n {
|
|
391
|
+
constructor() {
|
|
392
|
+
super(h), this.template = (t) => `
|
|
393
|
+
<px-container border-radius="none" padding="none">
|
|
394
|
+
<px-vstack>
|
|
395
|
+
<px-container id="header-container" border-radius="none">
|
|
396
|
+
<px-hstack>
|
|
397
|
+
<px-spacer></px-spacer>
|
|
398
|
+
<px-vstack
|
|
399
|
+
id="header-vstack-container"
|
|
400
|
+
gap="s"
|
|
401
|
+
grow="${this.grow}"
|
|
402
|
+
basis="${this.basis}"
|
|
403
|
+
>
|
|
404
|
+
<slot name="header-container"></slot>
|
|
405
|
+
</px-vstack>
|
|
406
|
+
<px-spacer></px-spacer>
|
|
407
|
+
</px-hstack>
|
|
408
|
+
</px-container>
|
|
409
|
+
<px-container
|
|
410
|
+
id="image-container"
|
|
411
|
+
border-radius="none"
|
|
412
|
+
padding="none"
|
|
413
|
+
padding-top="xl"
|
|
414
|
+
id="image-box"
|
|
415
|
+
background-size="cover"
|
|
416
|
+
background-position="top center"
|
|
417
|
+
padding-bottom="xl"
|
|
418
|
+
border-radius="none"
|
|
419
|
+
bgimg="${this.backgroundImage}"
|
|
420
|
+
>
|
|
421
|
+
<px-hstack>
|
|
422
|
+
<px-spacer></px-spacer>
|
|
423
|
+
<px-vstack grow="${this.grow}" basis="${this.basis}">
|
|
424
|
+
<slot name="image-container"></slot>
|
|
425
|
+
</px-vstack>
|
|
426
|
+
<px-spacer></px-spacer>
|
|
427
|
+
</px-hstack>
|
|
428
|
+
</px-container>
|
|
429
|
+
${t ? ` <px-hstack>
|
|
430
|
+
<px-spacer></px-spacer>
|
|
431
|
+
<px-container border-radius="none" box-shadow="xl" id="image-sticky-box" border="s" grow="${this.grow}" basis="${this.basis}" border-radius="m">
|
|
432
|
+
<px-vstack gap="s">
|
|
433
|
+
<slot name="image-sticky-container"></slot>
|
|
434
|
+
</px-vstack>
|
|
435
|
+
</px-container>
|
|
436
|
+
<px-spacer></px-spacer>
|
|
437
|
+
</px-hstack>` : ""}
|
|
438
|
+
<px-container
|
|
439
|
+
id="body-container"
|
|
440
|
+
id="main"
|
|
441
|
+
background-color="${this.backgroundColor}"
|
|
442
|
+
padding="none"
|
|
443
|
+
padding-top="xl"
|
|
444
|
+
padding-bottom="xl"
|
|
445
|
+
>
|
|
446
|
+
<px-hstack>
|
|
447
|
+
<px-spacer></px-spacer>
|
|
448
|
+
<px-vstack
|
|
449
|
+
id="body-vstack-container"
|
|
450
|
+
gap="l"
|
|
451
|
+
grow="${this.grow}"
|
|
452
|
+
basis="${this.basis}"
|
|
453
|
+
>
|
|
454
|
+
<slot name="body-container"></slot>
|
|
455
|
+
</px-vstack>
|
|
456
|
+
<px-spacer></px-spacer>
|
|
457
|
+
</px-hstack>
|
|
458
|
+
</px-container>
|
|
459
|
+
<px-container
|
|
460
|
+
id="contact-container"
|
|
461
|
+
border-radius="none"
|
|
462
|
+
id="main"
|
|
463
|
+
background-color="surface-default"
|
|
464
|
+
padding="none"
|
|
465
|
+
padding-top="xl"
|
|
466
|
+
padding-bottom="xl"
|
|
467
|
+
>
|
|
468
|
+
<px-hstack>
|
|
469
|
+
<px-spacer></px-spacer>
|
|
470
|
+
<px-vstack gap="l" grow="${this.grow}" basis="${this.basis}">
|
|
471
|
+
<slot name="contact-container"></slot>
|
|
472
|
+
</px-vstack>
|
|
473
|
+
<px-spacer></px-spacer>
|
|
474
|
+
</px-hstack>
|
|
475
|
+
</px-container>
|
|
476
|
+
<px-container
|
|
477
|
+
id="footer-container"
|
|
478
|
+
background-color="none"
|
|
479
|
+
border-radius="none"
|
|
480
|
+
style="background-color: rgb(108, 66, 156)"
|
|
481
|
+
padding-top="xl"
|
|
482
|
+
padding-bottom="xl"
|
|
483
|
+
>
|
|
484
|
+
<px-hstack>
|
|
485
|
+
<px-spacer></px-spacer>
|
|
486
|
+
<px-vstack gap="l" grow="${this.grow}" basis="${this.basis}">
|
|
487
|
+
<slot name="footer-container"></slot>
|
|
488
|
+
</px-vstack>
|
|
489
|
+
<px-spacer></px-spacer>
|
|
490
|
+
</px-hstack>
|
|
491
|
+
</px-container>
|
|
492
|
+
</px-vstack>
|
|
493
|
+
</px-container>
|
|
494
|
+
`, this.shadowRoot.innerHTML = this.template(!!this.$imageStickySlot);
|
|
495
|
+
}
|
|
496
|
+
static get observedAttributes() {
|
|
497
|
+
return [
|
|
498
|
+
...super.observedAttributes,
|
|
499
|
+
"background-image",
|
|
500
|
+
"gap",
|
|
501
|
+
"background-color",
|
|
502
|
+
"padding-vertical",
|
|
503
|
+
"padding-horizontal"
|
|
504
|
+
];
|
|
505
|
+
}
|
|
506
|
+
get $wideImage() {
|
|
507
|
+
return this.shadowRoot.querySelector("#image-box");
|
|
508
|
+
}
|
|
509
|
+
get $bodyVStackContainer() {
|
|
510
|
+
return this.shadowRoot.querySelector("#header-vstack-container");
|
|
511
|
+
}
|
|
512
|
+
get $bodyContainer() {
|
|
513
|
+
return this.shadowRoot.querySelector("#body-container");
|
|
514
|
+
}
|
|
515
|
+
get $contactContainer() {
|
|
516
|
+
return this.shadowRoot.querySelector("#contact-container");
|
|
517
|
+
}
|
|
518
|
+
get $footerContainer() {
|
|
519
|
+
return this.shadowRoot.querySelector("#footer-container");
|
|
520
|
+
}
|
|
521
|
+
get $headerContainer() {
|
|
522
|
+
return this.shadowRoot.querySelector("#header-container");
|
|
523
|
+
}
|
|
524
|
+
get $imageContainer() {
|
|
525
|
+
return this.shadowRoot.querySelector("#image-container");
|
|
526
|
+
}
|
|
527
|
+
get backgroundImage() {
|
|
528
|
+
return this.getAttribute("background-image");
|
|
529
|
+
}
|
|
530
|
+
get $imageStickySlot() {
|
|
531
|
+
return this.querySelector('*[slot="image-sticky-container"]');
|
|
532
|
+
}
|
|
533
|
+
get $main() {
|
|
534
|
+
return this.shadowRoot.querySelector("#main");
|
|
535
|
+
}
|
|
536
|
+
get backgroundColor() {
|
|
537
|
+
return this.getAttribute("background-color") || "none";
|
|
538
|
+
}
|
|
539
|
+
get paddingVertical() {
|
|
540
|
+
return this.getAttribute("padding-vertical");
|
|
541
|
+
}
|
|
542
|
+
get paddingHorizontal() {
|
|
543
|
+
return this.getAttribute("padding-horizontal");
|
|
544
|
+
}
|
|
545
|
+
set paddingVertical(t) {
|
|
546
|
+
this.setAttribute("padding-vertical", t);
|
|
547
|
+
}
|
|
548
|
+
set paddingHorizontal(t) {
|
|
549
|
+
this.setAttribute("padding-horizontal", t);
|
|
550
|
+
}
|
|
551
|
+
get gap() {
|
|
552
|
+
return this.getAttribute("gap");
|
|
553
|
+
}
|
|
554
|
+
connectedCallback() {
|
|
555
|
+
this.handlePaddingVerticalChange(this.paddingVertical), this.handlePaddingHorizontalChange(this.paddingHorizontal);
|
|
556
|
+
}
|
|
557
|
+
attributeChangedCallback(t, e, i) {
|
|
558
|
+
if (e !== i)
|
|
559
|
+
switch (t) {
|
|
560
|
+
case "background-image":
|
|
561
|
+
this.$imageContainer.setAttribute("background-image", i);
|
|
562
|
+
break;
|
|
563
|
+
case "gap":
|
|
564
|
+
this.$bodyVStackContainer.setAttribute("gap", i);
|
|
565
|
+
break;
|
|
566
|
+
case "background-color":
|
|
567
|
+
this.$bodyContainer.setAttribute(
|
|
568
|
+
"background-color",
|
|
569
|
+
k.indexOf(i) > 0 ? i : "none"
|
|
570
|
+
);
|
|
571
|
+
break;
|
|
572
|
+
case "padding-vertical":
|
|
573
|
+
this.handlePaddingVerticalChange(i);
|
|
574
|
+
break;
|
|
575
|
+
case "padding-horizontal":
|
|
576
|
+
this.handlePaddingHorizontalChange(i);
|
|
577
|
+
break;
|
|
578
|
+
default:
|
|
579
|
+
super.attributeChangedCallback(t, e, i);
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
handlePaddingVerticalChange(t) {
|
|
583
|
+
this.$headerContainer.setAttribute("padding-top", t), this.$footerContainer.setAttribute("padding-bottom", t);
|
|
584
|
+
}
|
|
585
|
+
handlePaddingHorizontalChange(t) {
|
|
586
|
+
this.$headerContainer.paddingLeft = t, this.$headerContainer.paddingRight = t, this.$bodyContainer.paddingLeft = t, this.$bodyContainer.paddingRight = t, this.$contactContainer.paddingLeft = t, this.$contactContainer.paddingRight = t, this.$footerContainer.paddingLeft = t, this.$footerContainer.paddingRight = t, this.$imageContainer.paddingLeft = t, this.$imageContainer.paddingRight = t;
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
customElements.get("px-page") === void 0 && customElements.define("px-page", D);
|
|
590
|
+
const z = ':host{display:block;font-family:var(--px-font-family);font-size:var(--px-font-size-base)}:host *{box-sizing:border-box}.selectable-box{display:flex;flex-direction:column;height:100%}::slotted([slot="media"]){width:100%;height:auto}.info{display:flex;flex-grow:1}.info .info__body{display:flex;flex-direction:column;flex-basis:80%;gap:var(--px-spacing-default-mobile);padding:var(--px-padding-m-mobile);flex-grow:1}.info .info__body .header{display:flex;align-items:center;gap:var(--px-spacing-s-mobile);flex-grow:1}.info .info__body .header .titles{display:flex;flex-direction:column;gap:var(--px-spacing-xs-mobile)}.info .info__body .header .titles ::slotted([slot="title"]){font-size:var(--px-text-size-label-m-mobile);font-weight:var(--px-font-weight-title);line-height:var(--px-line-height-ratio-l);color:var(--px-color-text-neutral-default);flex-grow:1}.info .info__body .header .titles ::slotted([slot="description"]){font-size:var(--px-text-size-label-m-mobile);font-weight:var(--px-font-weight-body);line-height:var(--px-line-height-ratio-l);color:var(--px-color-text-dimmed-default);flex-grow:1}.info .info__body ::slotted([slot="content"]){color:var(--px-color-text-neutral-default)}.info .info__footer{display:flex;align-items:center;padding:var(--px-padding-s-mobile);background:var(--px-color-background-container-default-default);text-align:center}:host([hide-footer]) .info .info__body{flex-basis:auto}:host([hide-footer]) .info__footer{display:none}@media only screen and (min-width: 48em){.info{flex-direction:column}.info .info__body{flex-basis:auto;gap:var(--px-spacing-default-tablet);padding:var(--px-padding-m-tablet)}.info .info__body .header{gap:var(--px-spacing-s-tablet)}.info .info__body .header .titles{gap:var(--px-spacing-xs-tablet)}.info .info__body .header .titles ::slotted([slot="title"]){font-size:var(--px-text-size-label-m-tablet)}.info .info__body .header .titles ::slotted([slot="description"]){font-size:var(--px-text-size-label-m-tablet)}.info .info__footer{justify-content:center;padding:var(--px-padding-s-tablet)}}@media only screen and (min-width: 64.0625em){.info .info__body{gap:var(--px-spacing-default-laptop);padding:var(--px-padding-m-laptop)}.info .info__body .header{gap:var(--px-spacing-s-laptop)}.info .info__body .header .titles{gap:var(--px-spacing-xs-laptop)}.info .info__body .header .titles ::slotted([slot="title"]){font-size:var(--px-text-size-label-m-laptop)}.info .info__body .header .titles ::slotted([slot="description"]){font-size:var(--px-text-size-label-m-laptop)}.info .info__footer{padding:var(--px-padding-s-laptop)}}@media only screen and (min-width: 90.0625em){.info .info__body{gap:var(--px-spacing-default-desktop);padding:var(--px-padding-m-desktop)}.info .info__body .header{gap:var(--px-spacing-s-desktop)}.info .info__body .header .titles{gap:var(--px-spacing-xs-desktop)}.info .info__body .header .titles ::slotted([slot="title"]){font-size:var(--px-text-size-label-m-desktop)}.info .info__body .header .titles ::slotted([slot="description"]){font-size:var(--px-text-size-label-m-desktop)}.info .info__footer{padding:var(--px-padding-s-desktop)}}:host([inverted]) .info .info__body .header .titles ::slotted([slot="title"]){color:var(--px-color-text-neutral-inverted)}:host([inverted]) .info .info__body .header .titles ::slotted([slot="description"]){color:var(--px-color-text-dimmed-inverted)}:host([inverted]) .info .info__body ::slotted([slot="content"]){color:var(--px-color-text-neutral-inverted)}:host([inverted]) .info .info__footer{background:var(--px-color-background-container-default-inverted)}', p = new CSSStyleSheet();
|
|
591
|
+
p.replaceSync(z);
|
|
592
|
+
class R extends n {
|
|
593
|
+
template() {
|
|
594
|
+
return `
|
|
595
|
+
<div class="selectable-box">
|
|
596
|
+
<slot name="media"></slot>
|
|
597
|
+
<div class="info">
|
|
598
|
+
<div class="info__body">
|
|
599
|
+
<div class="header">
|
|
600
|
+
<slot name="action"></slot>
|
|
601
|
+
<slot name="icon"></slot>
|
|
602
|
+
<slot name="logo"></slot>
|
|
603
|
+
<div class="titles">
|
|
604
|
+
<slot name="title"></slot>
|
|
605
|
+
<slot name="description"></slot>
|
|
606
|
+
</div>
|
|
607
|
+
</div>
|
|
608
|
+
<slot name="content"></slot>
|
|
609
|
+
</div>
|
|
610
|
+
<div class="info__footer">
|
|
611
|
+
<slot name="footer"></slot>
|
|
612
|
+
</div>
|
|
613
|
+
</div>
|
|
614
|
+
</div>
|
|
615
|
+
`;
|
|
616
|
+
}
|
|
617
|
+
constructor() {
|
|
618
|
+
super(p), this.shadowRoot.innerHTML = this.template();
|
|
619
|
+
}
|
|
620
|
+
static get observedAttributes() {
|
|
621
|
+
return [...super.observedAttributes, "inverted", "hide-footer"];
|
|
622
|
+
}
|
|
623
|
+
attributeChangedCallback(t, e, i) {
|
|
624
|
+
if (e !== i)
|
|
625
|
+
switch (t) {
|
|
626
|
+
default:
|
|
627
|
+
super.attributeChangedCallback(t, e, i);
|
|
628
|
+
break;
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
get $el() {
|
|
632
|
+
return this.shadowRoot.querySelector(".selectable-box");
|
|
633
|
+
}
|
|
634
|
+
get inverted() {
|
|
635
|
+
return this.hasAttribute("inverted");
|
|
636
|
+
}
|
|
637
|
+
set inverted(t) {
|
|
638
|
+
t ? this.setAttribute("inverted", "") : this.removeAttribute("inverted");
|
|
639
|
+
}
|
|
640
|
+
get hideFooter() {
|
|
641
|
+
return this.hasAttribute("hide-footer");
|
|
642
|
+
}
|
|
643
|
+
set hideFooter(t) {
|
|
644
|
+
t ? this.setAttribute("hide-footer", "") : this.removeAttribute("hide-footer");
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
customElements.get("px-selectable-box") || customElements.define("px-selectable-box", R);
|
|
648
|
+
const u = ':host{display:block;outline:none}:host *{box-sizing:border-box}.selectable-box-checkbox,.selectable-box-radio{box-sizing:border-box;height:100%;cursor:pointer;border-radius:var(--px-radius-main);overflow:hidden;--btn-transition: all .2s ease-in-out 0s;transition:var(--btn-transition);border:var(--px-size-border-m) solid var(--px-color-border-main-default);outline-color:var(--px-color-border-focus-outline-default);outline-width:var(--px-focus-outline-mobile)}.selectable-box-checkbox px-selectable-box,.selectable-box-radio px-selectable-box{height:100%;background-color:var(--px-color-background-container-light-default)}:host(:not([disabled])):host(:hover) .selectable-box-checkbox,:host(:not([disabled])):host(:hover) .selectable-box-radio{border-color:var(--px-color-border-state-hover-default)}:host(:not([disabled])):host(:hover) .selectable-box-checkbox px-selectable-box,:host(:not([disabled])):host(:hover) .selectable-box-radio px-selectable-box{background-color:var( --px-color-background-state-hover-bordered-default )}:host(:not([disabled])):host(:focus-visible) .selectable-box-checkbox,:host(:not([disabled])):host(:focus-visible) .selectable-box-radio{outline-offset:var(--px-focus-offset-mobile);outline-style:solid}:host([checked]) .selectable-box-checkbox,:host([checked]) .selectable-box-radio{border-color:var(--px-color-border-state-active-default)}:host([disabled]) .selectable-box-checkbox,:host([disabled]) .selectable-box-radio{cursor:default;pointer-events:none}:host([disabled]) .selectable-box-checkbox px-selectable-box,:host([disabled]) .selectable-box-radio px-selectable-box{background-color:var(--px-color-background-state-disabled-default)}:host([disabled]) ::slotted([slot="title"]),:host([disabled]) ::slotted([slot="description"]),:host([disabled]) ::slotted([slot="content"]){color:var(--px-color-text-state-disabled-default)}@media only screen and (min-width: 48em){.selectable-box-checkbox,.selectable-box-radio{outline-width:var(--px-focus-outline-tablet)}}@media only screen and (min-width: 64.0625em){.selectable-box-checkbox,.selectable-box-radio{outline-width:var(--px-focus-outline-laptop)}}@media only screen and (min-width: 90.0625em){.selectable-box-checkbox,.selectable-box-radio{outline-width:var(--px-focus-outline-desktop)}}:host([inverted]) .selectable-box-checkbox,:host([inverted]) .selectable-box-radio{border-color:var(--px-color-border-main-inverted);outline-color:var(--px-color-border-focus-outline-inverted)}:host([inverted]) .selectable-box-checkbox px-selectable-box,:host([inverted]) .selectable-box-radio px-selectable-box{background-color:var(--px-color-background-container-light-inverted)}:host([inverted]):host(:not([disabled])):host(:hover) .selectable-box-checkbox,:host([inverted]):host(:not([disabled])):host(:hover) .selectable-box-radio{border-color:var(--px-color-border-state-hover-inverted)}:host([inverted]):host(:not([disabled])):host(:hover) .selectable-box-checkbox px-selectable-box,:host([inverted]):host(:not([disabled])):host(:hover) .selectable-box-radio px-selectable-box{background-color:var( --px-color-background-state-hover-bordered-inverted )}:host([inverted]):host([checked]) .selectable-box-checkbox,:host([inverted]):host([checked]) .selectable-box-radio{border-color:var(--px-color-border-state-active-inverted)}:host([inverted]):host([disabled]) .selectable-box-checkbox px-selectable-box,:host([inverted]):host([disabled]) .selectable-box-radio px-selectable-box{background-color:var(--px-color-background-state-disabled-inverted)}:host([inverted]):host([disabled]) ::slotted([slot="title"]),:host([inverted]):host([disabled]) ::slotted([slot="description"]),:host([inverted]):host([disabled]) ::slotted([slot="content"]){color:var(--px-color-text-state-disabled-inverted)}', g = new CSSStyleSheet();
|
|
649
|
+
g.replaceSync(u);
|
|
650
|
+
class F extends n {
|
|
651
|
+
template() {
|
|
652
|
+
return `
|
|
653
|
+
<div class="selectable-box-checkbox">
|
|
654
|
+
<px-selectable-box>
|
|
655
|
+
<slot name="media" slot="media"></slot>
|
|
656
|
+
<px-checkbox
|
|
657
|
+
slot="action" aria-hidden="true" tabindex="-1"
|
|
658
|
+
name="${this.name}"
|
|
659
|
+
value="${this.value}"
|
|
660
|
+
></px-checkbox>
|
|
661
|
+
<slot name="icon" slot="icon"></slot>
|
|
662
|
+
<slot name="logo" slot="logo"></slot>
|
|
663
|
+
<slot name="title" slot="title"></slot>
|
|
664
|
+
<slot name="description" slot="description"></slot>
|
|
665
|
+
<slot name="content" slot="content"></slot>
|
|
666
|
+
<slot name="footer" slot="footer"></slot>
|
|
667
|
+
</px-selectable-box>
|
|
668
|
+
</div>
|
|
669
|
+
`;
|
|
670
|
+
}
|
|
671
|
+
constructor() {
|
|
672
|
+
var t;
|
|
673
|
+
super(g), this.shadowRoot.innerHTML = this.template(), this.internals = (t = this.attachInternals) == null ? void 0 : t.call(this), this.tabIndex = 0, this.internals && (this.internals.role = "checkbox", this.internals.ariaChecked = `${this.checked}`);
|
|
674
|
+
}
|
|
675
|
+
connectedCallback() {
|
|
676
|
+
this.toggleFooterVisibility(), this.$slotFooter.addEventListener(
|
|
677
|
+
"slotchange",
|
|
678
|
+
this.toggleFooterVisibility
|
|
679
|
+
), this.addEventListener("mouseover", this.setHoverAttribute), this.addEventListener("mouseout", this.removeHoverAttribute), this.addEventListener("keypress", this.setKeypressEvent), this.addEventListener("click", this.setClickEvent), this.hasAttribute("checked") && (this.checked = !0);
|
|
680
|
+
}
|
|
681
|
+
static get observedAttributes() {
|
|
682
|
+
return [
|
|
683
|
+
...super.observedAttributes,
|
|
684
|
+
"inverted",
|
|
685
|
+
"name",
|
|
686
|
+
"value",
|
|
687
|
+
"checked",
|
|
688
|
+
"disabled"
|
|
689
|
+
];
|
|
690
|
+
}
|
|
691
|
+
attributeChangedCallback(t, e, i) {
|
|
692
|
+
if (e !== i)
|
|
693
|
+
switch (t) {
|
|
694
|
+
case "inverted":
|
|
695
|
+
this.inverted ? (this.$selectableBox.setAttribute("inverted", ""), this.$checkbox.setAttribute("inverted", "")) : (this.$selectableBox.removeAttribute("inverted"), this.$checkbox.removeAttribute("inverted"));
|
|
696
|
+
break;
|
|
697
|
+
case "name":
|
|
698
|
+
case "value":
|
|
699
|
+
this.$checkbox && this.$checkbox.setAttribute(t, i);
|
|
700
|
+
break;
|
|
701
|
+
case "disabled":
|
|
702
|
+
this.handleDisabledAttributeChange(i !== null);
|
|
703
|
+
break;
|
|
704
|
+
case "checked":
|
|
705
|
+
this.handleCheckedAttributeChange(i);
|
|
706
|
+
break;
|
|
707
|
+
default:
|
|
708
|
+
super.attributeChangedCallback(t, e, i);
|
|
709
|
+
break;
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
disconnectedCallback() {
|
|
713
|
+
this.$slotFooter.removeEventListener(
|
|
714
|
+
"slotchange",
|
|
715
|
+
this.toggleFooterVisibility
|
|
716
|
+
), this.removeEventListener("mouseover", this.setHoverAttribute), this.removeEventListener("mouseout", this.removeHoverAttribute), this.removeEventListener("keypress", this.setKeypressEvent), this.removeEventListener("click", this.setClickEvent);
|
|
717
|
+
}
|
|
718
|
+
removeHoverAttribute() {
|
|
719
|
+
this.$checkbox.removeAttribute("hover");
|
|
720
|
+
}
|
|
721
|
+
setHoverAttribute() {
|
|
722
|
+
this.$checkbox.setAttribute("hover", "");
|
|
723
|
+
}
|
|
724
|
+
setKeypressEvent(t) {
|
|
725
|
+
switch (t.stopPropagation(), t.preventDefault(), t.code) {
|
|
726
|
+
case "Space":
|
|
727
|
+
this.click();
|
|
728
|
+
break;
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
setClickEvent(t) {
|
|
732
|
+
this.checked = !this.checked, t.stopPropagation(), t.preventDefault();
|
|
733
|
+
}
|
|
734
|
+
toggleFooterVisibility() {
|
|
735
|
+
this.$slottedFooter ? this.$selectableBox.removeAttribute("hide-footer") : this.$selectableBox.setAttribute("hide-footer", "");
|
|
736
|
+
}
|
|
737
|
+
handleDisabledAttributeChange(t) {
|
|
738
|
+
t ? (this.disabled = !0, this.internals && (this.internals.ariaDisabled = "true"), this.$checkbox.setAttribute("disabled", "")) : (this.disabled = !1, this.internals && (this.internals.ariaDisabled = "false"), this.$checkbox.removeAttribute("disabled"));
|
|
739
|
+
}
|
|
740
|
+
handleCheckedAttributeChange(t) {
|
|
741
|
+
var e;
|
|
742
|
+
(e = this.internals) == null || e.setFormValue(this.formData()), t === null ? (this.internals && (this.internals.ariaChecked = "false"), this.checked = !1, this.$checkbox && this.$checkbox.removeAttribute("checked")) : (this.internals && (this.internals.ariaChecked = "true"), this.checked = !0, this.$checkbox && this.$checkbox.setAttribute("checked", ""), this.dispatchEvent(
|
|
743
|
+
new Event("change", {
|
|
744
|
+
bubbles: !0,
|
|
745
|
+
composed: !0
|
|
746
|
+
// Allow the event to pass through shadow DOM boundaries
|
|
747
|
+
})
|
|
748
|
+
));
|
|
749
|
+
}
|
|
750
|
+
// Form-associated callbacks
|
|
751
|
+
static get formAssociated() {
|
|
752
|
+
return !0;
|
|
753
|
+
}
|
|
754
|
+
// Set default behavior when the element is attached to a form
|
|
755
|
+
formResetCallback() {
|
|
756
|
+
this.checked = !1;
|
|
757
|
+
}
|
|
758
|
+
formStateRestoreCallback(t) {
|
|
759
|
+
this.checked = t;
|
|
760
|
+
}
|
|
761
|
+
formData() {
|
|
762
|
+
if (this.name) {
|
|
763
|
+
const t = new FormData(), e = this.getAttribute("name");
|
|
764
|
+
return e && (this.checked ? t.set(e, this.value) : t.delete(e)), t;
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
get $el() {
|
|
768
|
+
return this.shadowRoot.querySelector(
|
|
769
|
+
".selectable-box-checkbox"
|
|
770
|
+
);
|
|
771
|
+
}
|
|
772
|
+
get $selectableBox() {
|
|
773
|
+
return this.shadowRoot.querySelector("px-selectable-box");
|
|
774
|
+
}
|
|
775
|
+
get $checkbox() {
|
|
776
|
+
return this.shadowRoot.querySelector("px-checkbox");
|
|
777
|
+
}
|
|
778
|
+
get $slotFooter() {
|
|
779
|
+
return this.shadowRoot.querySelector(
|
|
780
|
+
'slot[name="footer"]'
|
|
781
|
+
);
|
|
782
|
+
}
|
|
783
|
+
get $slottedFooter() {
|
|
784
|
+
return this.querySelector('[slot="footer"]');
|
|
785
|
+
}
|
|
786
|
+
get inverted() {
|
|
787
|
+
return this.hasAttribute("inverted");
|
|
788
|
+
}
|
|
789
|
+
set inverted(t) {
|
|
790
|
+
t ? this.setAttribute("inverted", "") : this.removeAttribute("inverted");
|
|
791
|
+
}
|
|
792
|
+
get checked() {
|
|
793
|
+
return this.hasAttribute("checked");
|
|
794
|
+
}
|
|
795
|
+
set checked(t) {
|
|
796
|
+
t ? this.setAttribute("checked", "") : this.removeAttribute("checked");
|
|
797
|
+
}
|
|
798
|
+
get name() {
|
|
799
|
+
return this.getAttribute("name");
|
|
800
|
+
}
|
|
801
|
+
set name(t) {
|
|
802
|
+
t ? this.setAttribute("name", t) : this.removeAttribute("name");
|
|
803
|
+
}
|
|
804
|
+
get disabled() {
|
|
805
|
+
return this.hasAttribute("disabled");
|
|
806
|
+
}
|
|
807
|
+
set disabled(t) {
|
|
808
|
+
t ? this.setAttribute("disabled", "") : this.removeAttribute("disabled");
|
|
809
|
+
}
|
|
810
|
+
get value() {
|
|
811
|
+
return this.getAttribute("value");
|
|
812
|
+
}
|
|
813
|
+
set value(t) {
|
|
814
|
+
t ? this.setAttribute("value", t) : this.removeAttribute("value");
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
customElements.get("px-selectable-box-checkbox") || customElements.define("px-selectable-box-checkbox", F);
|
|
818
|
+
const x = new CSSStyleSheet();
|
|
819
|
+
x.replaceSync(u);
|
|
820
|
+
class H extends n {
|
|
821
|
+
template() {
|
|
822
|
+
return `
|
|
823
|
+
<div class="selectable-box-radio">
|
|
824
|
+
<px-selectable-box>
|
|
825
|
+
<slot name="media" slot="media"></slot>
|
|
826
|
+
<px-radio-base
|
|
827
|
+
slot="action" aria-hidden="true" tabindex="-1"
|
|
828
|
+
name="${this.name}"
|
|
829
|
+
value="${this.value}"
|
|
830
|
+
></px-radio-base>
|
|
831
|
+
<slot name="icon" slot="icon"></slot>
|
|
832
|
+
<slot name="logo" slot="logo"></slot>
|
|
833
|
+
<slot name="title" slot="title"></slot>
|
|
834
|
+
<slot name="description" slot="description"></slot>
|
|
835
|
+
<slot name="content" slot="content"></slot>
|
|
836
|
+
<slot name="footer" slot="footer"></slot>
|
|
837
|
+
</px-selectable-box>
|
|
838
|
+
</div>
|
|
839
|
+
`;
|
|
840
|
+
}
|
|
841
|
+
constructor() {
|
|
842
|
+
var t, e;
|
|
843
|
+
super(x), this.shadowRoot.innerHTML = this.template(), this.internals = (t = this.attachInternals) == null ? void 0 : t.call(this), this.tabIndex = ((e = this.parentElement) == null ? void 0 : e.firstElementChild) === this ? 0 : -1, this.internals && (this.internals.role = "radio", this.internals.ariaChecked = `${this.checked}`);
|
|
844
|
+
}
|
|
845
|
+
connectedCallback() {
|
|
846
|
+
this.toggleFooterVisibility(), this.$slotFooter.addEventListener(
|
|
847
|
+
"slotchange",
|
|
848
|
+
this.toggleFooterVisibility
|
|
849
|
+
), this.addEventListener("mouseover", this.setHoverAttribute), this.addEventListener("mouseout", this.removeHoverAttribute), this.addEventListener("keypress", this.setKeypressEvent), this.addEventListener("click", this.setClickEvent), this.hasAttribute("checked") && (this.checked = !0);
|
|
850
|
+
}
|
|
851
|
+
static get observedAttributes() {
|
|
852
|
+
return [
|
|
853
|
+
...super.observedAttributes,
|
|
854
|
+
"inverted",
|
|
855
|
+
"name",
|
|
856
|
+
"value",
|
|
857
|
+
"checked",
|
|
858
|
+
"disabled"
|
|
859
|
+
];
|
|
860
|
+
}
|
|
861
|
+
attributeChangedCallback(t, e, i) {
|
|
862
|
+
if (e !== i)
|
|
863
|
+
switch (t) {
|
|
864
|
+
case "inverted":
|
|
865
|
+
this.inverted ? (this.$selectableBox.setAttribute("inverted", ""), this.$radio.setAttribute("inverted", "")) : (this.$selectableBox.removeAttribute("inverted"), this.$radio.removeAttribute("inverted"));
|
|
866
|
+
break;
|
|
867
|
+
case "name":
|
|
868
|
+
case "value":
|
|
869
|
+
this.$radio && this.$radio.setAttribute(t, i);
|
|
870
|
+
break;
|
|
871
|
+
case "disabled":
|
|
872
|
+
this.handleDisabledAttributeChange(i !== null);
|
|
873
|
+
break;
|
|
874
|
+
case "checked":
|
|
875
|
+
this.handleCheckedAttributeChange(i);
|
|
876
|
+
break;
|
|
877
|
+
default:
|
|
878
|
+
super.attributeChangedCallback(t, e, i);
|
|
879
|
+
break;
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
disconnectedCallback() {
|
|
883
|
+
this.$slotFooter.removeEventListener(
|
|
884
|
+
"slotchange",
|
|
885
|
+
this.toggleFooterVisibility
|
|
886
|
+
), this.removeEventListener("mouseover", this.setHoverAttribute), this.removeEventListener("mouseout", this.removeHoverAttribute), this.removeEventListener("keypress", this.setKeypressEvent), this.removeEventListener("click", this.setClickEvent);
|
|
887
|
+
}
|
|
888
|
+
removeHoverAttribute() {
|
|
889
|
+
this.$radio.removeAttribute("hover");
|
|
890
|
+
}
|
|
891
|
+
setHoverAttribute() {
|
|
892
|
+
this.$radio.setAttribute("hover", "");
|
|
893
|
+
}
|
|
894
|
+
setKeypressEvent(t) {
|
|
895
|
+
switch (t.preventDefault(), t.code) {
|
|
896
|
+
case "Space":
|
|
897
|
+
this.click();
|
|
898
|
+
break;
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
setClickEvent(t) {
|
|
902
|
+
this.checked || (this.checked = !0), t.stopPropagation(), t.preventDefault();
|
|
903
|
+
}
|
|
904
|
+
toggleFooterVisibility() {
|
|
905
|
+
this.$slottedFooter ? this.$selectableBox.removeAttribute("hide-footer") : this.$selectableBox.setAttribute("hide-footer", "");
|
|
906
|
+
}
|
|
907
|
+
handleDisabledAttributeChange(t) {
|
|
908
|
+
t ? (this.disabled = !0, this.internals && (this.internals.ariaDisabled = "true"), this.$radio.setAttribute("disabled", "")) : (this.disabled = !1, this.internals && (this.internals.ariaDisabled = "false"), this.$radio.removeAttribute("disabled"));
|
|
909
|
+
}
|
|
910
|
+
handleCheckedAttributeChange(t) {
|
|
911
|
+
var e;
|
|
912
|
+
(e = this.internals) == null || e.setFormValue(this.formData()), t === null ? (this.internals && (this.internals.ariaChecked = "false"), this.setAttribute("tabIndex", "-1"), this.checked = !1, this.$radio && this.$radio.removeAttribute("checked")) : (this.internals && (this.internals.ariaChecked = "true"), this.setAttribute("tabIndex", "0"), this.checked = !0, this.$radio && this.$radio.setAttribute("checked", ""), this.dispatchEvent(
|
|
913
|
+
new Event("change", {
|
|
914
|
+
bubbles: !0,
|
|
915
|
+
composed: !0
|
|
916
|
+
// Allow the event to pass through shadow DOM boundaries
|
|
917
|
+
})
|
|
918
|
+
));
|
|
919
|
+
}
|
|
920
|
+
// Form-associated callbacks
|
|
921
|
+
static get formAssociated() {
|
|
922
|
+
return !0;
|
|
923
|
+
}
|
|
924
|
+
// Set default behavior when the element is attached to a form
|
|
925
|
+
formResetCallback() {
|
|
926
|
+
this.checked = !1;
|
|
927
|
+
}
|
|
928
|
+
formStateRestoreCallback(t) {
|
|
929
|
+
this.checked = t;
|
|
930
|
+
}
|
|
931
|
+
formData() {
|
|
932
|
+
if (this.name) {
|
|
933
|
+
const t = new FormData(), e = this.getAttribute("name");
|
|
934
|
+
return e && (this.checked ? t.set(e, this.value) : t.delete(e)), t;
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
get $el() {
|
|
938
|
+
return this.shadowRoot.querySelector(
|
|
939
|
+
".selectable-box-radio"
|
|
940
|
+
);
|
|
941
|
+
}
|
|
942
|
+
get $selectableBox() {
|
|
943
|
+
return this.shadowRoot.querySelector("px-selectable-box");
|
|
944
|
+
}
|
|
945
|
+
get $radio() {
|
|
946
|
+
return this.shadowRoot.querySelector("px-radio-base");
|
|
947
|
+
}
|
|
948
|
+
get $slotFooter() {
|
|
949
|
+
return this.shadowRoot.querySelector(
|
|
950
|
+
'slot[name="footer"]'
|
|
951
|
+
);
|
|
952
|
+
}
|
|
953
|
+
get $slottedFooter() {
|
|
954
|
+
return this.querySelector('[slot="footer"]');
|
|
955
|
+
}
|
|
956
|
+
get inverted() {
|
|
957
|
+
return this.hasAttribute("inverted");
|
|
958
|
+
}
|
|
959
|
+
set inverted(t) {
|
|
960
|
+
t ? this.setAttribute("inverted", "") : this.removeAttribute("inverted");
|
|
961
|
+
}
|
|
962
|
+
get checked() {
|
|
963
|
+
return this.hasAttribute("checked");
|
|
964
|
+
}
|
|
965
|
+
set checked(t) {
|
|
966
|
+
t ? this.setAttribute("checked", "") : this.removeAttribute("checked");
|
|
967
|
+
}
|
|
968
|
+
get name() {
|
|
969
|
+
return this.getAttribute("name");
|
|
970
|
+
}
|
|
971
|
+
set name(t) {
|
|
972
|
+
t ? this.setAttribute("name", t) : this.removeAttribute("name");
|
|
973
|
+
}
|
|
974
|
+
get disabled() {
|
|
975
|
+
return this.hasAttribute("disabled");
|
|
976
|
+
}
|
|
977
|
+
set disabled(t) {
|
|
978
|
+
t ? this.setAttribute("disabled", "") : this.removeAttribute("disabled");
|
|
979
|
+
}
|
|
980
|
+
get value() {
|
|
981
|
+
return this.getAttribute("value");
|
|
982
|
+
}
|
|
983
|
+
set value(t) {
|
|
984
|
+
t ? this.setAttribute("value", t) : this.removeAttribute("value");
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
customElements.get("px-selectable-box-radio") || customElements.define("px-selectable-box-radio", H);
|
|
988
|
+
export {
|
|
989
|
+
R as SelectableBox,
|
|
990
|
+
F as SelectableBoxCheckbox,
|
|
991
|
+
H as SelectableBoxRadio
|
|
992
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@proximus/lavender-selectablebox",
|
|
3
|
+
"version": "1.0.0-alpha.10",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.es.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"type": "module",
|
|
11
|
+
"scripts": {
|
|
12
|
+
"transform-package-json": "node ../../../scripts/tranformPackageJson.js package.json dist/far/away",
|
|
13
|
+
"clean": "rm -rf dist",
|
|
14
|
+
"build": "npm run clean && NODE_ENV=development vite build && tsc && npm run transform-package-json",
|
|
15
|
+
"test": "vitest run --coverage"
|
|
16
|
+
},
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public"
|
|
19
|
+
}
|
|
20
|
+
}
|