@spw-ds/spw-stencil-library 1.17.2 → 1.17.3-alpha.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.
- package/dist/cem.json +167 -0
- package/dist/cjs/index-D3lyhQSW.js +4 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/spw-alert.cjs.entry.js +55 -0
- package/dist/cjs/spw-date-picker.cjs.entry.js +5 -2
- package/dist/cjs/spw-field-label_8.cjs.entry.js +8 -13
- package/dist/cjs/spw-header-lang.cjs.entry.js +14 -5
- package/dist/cjs/spw-header-navigation-item.cjs.entry.js +127 -2
- package/dist/cjs/spw-header-persona.cjs.entry.js +16 -7
- package/dist/cjs/spw-search-field.cjs.entry.js +1 -1
- package/dist/cjs/spw-stencil-library.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/spw-alert/spw-alert.css +446 -0
- package/dist/collection/components/spw-alert/spw-alert.js +202 -0
- package/dist/collection/components/spw-date-picker/spw-date-picker.js +5 -2
- package/dist/collection/components/spw-group/spw-group.js +8 -13
- package/dist/collection/components/spw-header/spw-header-lang/spw-header-lang.js +14 -5
- package/dist/collection/components/spw-header/spw-header-navigation-item/spw-header-navigation-item.css +8 -8
- package/dist/collection/components/spw-header/spw-header-navigation-item/spw-header-navigation-item.js +128 -2
- package/dist/collection/components/spw-header/spw-header-persona/spw-header-persona.css +9 -5
- package/dist/collection/components/spw-header/spw-header-persona/spw-header-persona.js +15 -6
- package/dist/collection/components/spw-search-field/spw-search-field.css +3 -1
- package/dist/components/spw-alert.d.ts +11 -0
- package/dist/components/spw-alert.js +1 -0
- package/dist/components/spw-date-picker.js +1 -1
- package/dist/components/spw-group.js +1 -1
- package/dist/components/spw-header-lang.js +1 -1
- package/dist/components/spw-header-navigation-item.js +1 -1
- package/dist/components/spw-header-persona.js +1 -1
- package/dist/components/spw-search-field.js +1 -1
- package/dist/components_json.json +223 -2
- package/dist/components_vscode.json +25 -0
- package/dist/esm/index-DkNryMko.js +4 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/spw-alert.entry.js +53 -0
- package/dist/esm/spw-date-picker.entry.js +5 -2
- package/dist/esm/spw-field-label_8.entry.js +8 -13
- package/dist/esm/spw-header-lang.entry.js +14 -5
- package/dist/esm/spw-header-navigation-item.entry.js +127 -2
- package/dist/esm/spw-header-persona.entry.js +16 -7
- package/dist/esm/spw-search-field.entry.js +1 -1
- package/dist/esm/spw-stencil-library.js +1 -1
- package/dist/spw-stencil-library/p-00c70684.entry.js +1 -0
- package/dist/spw-stencil-library/p-0bf3f71f.entry.js +1 -0
- package/dist/spw-stencil-library/{p-6cfcab87.entry.js → p-1fdace00.entry.js} +1 -1
- package/dist/spw-stencil-library/p-550df37a.entry.js +1 -0
- package/dist/spw-stencil-library/p-7807d0c0.entry.js +1 -0
- package/dist/spw-stencil-library/p-7ab7181d.entry.js +1 -0
- package/dist/spw-stencil-library/{p-d38ec8b1.entry.js → p-d1917f78.entry.js} +1 -1
- package/dist/spw-stencil-library/spw-stencil-library.esm.js +1 -1
- package/dist/stats.json +639 -55
- package/dist/types/components/spw-alert/spw-alert.d.ts +31 -0
- package/dist/types/components/spw-group/spw-group.d.ts +2 -0
- package/dist/types/components/spw-header/spw-header-lang/spw-header-lang.d.ts +1 -0
- package/dist/types/components/spw-header/spw-header-navigation-item/spw-header-navigation-item.d.ts +14 -0
- package/dist/types/components/spw-header/spw-header-persona/spw-header-persona.d.ts +1 -0
- package/dist/types/components.d.ts +84 -0
- package/hydrate/index.js +241 -31
- package/hydrate/index.mjs +241 -31
- package/package.json +1 -1
- package/dist/spw-stencil-library/p-0043c2f4.entry.js +0 -1
- package/dist/spw-stencil-library/p-7e2bf8ad.entry.js +0 -1
- package/dist/spw-stencil-library/p-8a8faafd.entry.js +0 -1
- package/dist/spw-stencil-library/p-feca6945.entry.js +0 -1
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
|
|
2
|
+
/* Document
|
|
3
|
+
========================================================================== */
|
|
4
|
+
/**
|
|
5
|
+
* 1. Correct the line height in all browsers.
|
|
6
|
+
* 2. Prevent adjustments of font size after orientation changes in iOS.
|
|
7
|
+
*/
|
|
8
|
+
html {
|
|
9
|
+
line-height: 1.3; /* 1 */
|
|
10
|
+
-webkit-text-size-adjust: 100%; /* 2 */
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
h1,
|
|
14
|
+
h2,
|
|
15
|
+
h3,
|
|
16
|
+
h4,
|
|
17
|
+
h5,
|
|
18
|
+
h6,
|
|
19
|
+
p,
|
|
20
|
+
ul,
|
|
21
|
+
li {
|
|
22
|
+
padding: 0;
|
|
23
|
+
margin: 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
ul {
|
|
27
|
+
list-style: none;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:host {
|
|
31
|
+
box-sizing: border-box;
|
|
32
|
+
line-height: 1.3;
|
|
33
|
+
-webkit-text-size-adjust: 100%;
|
|
34
|
+
font-size: 100%;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
:host *,
|
|
38
|
+
:host *::before,
|
|
39
|
+
:host *::after {
|
|
40
|
+
box-sizing: inherit;
|
|
41
|
+
font-family: var(--spw-ds-font-main);
|
|
42
|
+
letter-spacing: -0.18px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* Sections
|
|
46
|
+
========================================================================== */
|
|
47
|
+
/**
|
|
48
|
+
* Remove the margin in all browsers.
|
|
49
|
+
*/
|
|
50
|
+
body {
|
|
51
|
+
margin: 0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* Grouping content
|
|
55
|
+
========================================================================== */
|
|
56
|
+
/**
|
|
57
|
+
* 1. Add the correct box sizing in Firefox.
|
|
58
|
+
* 2. Show the overflow in Edge and IE.
|
|
59
|
+
*/
|
|
60
|
+
hr {
|
|
61
|
+
box-sizing: content-box; /* 1 */
|
|
62
|
+
height: 0; /* 1 */
|
|
63
|
+
overflow: visible; /* 2 */
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* 1. Correct the inheritance and scaling of font size in all browsers.
|
|
68
|
+
* 2. Correct the odd `em` font sizing in all browsers.
|
|
69
|
+
*/
|
|
70
|
+
pre {
|
|
71
|
+
font-family: monospace, monospace; /* 1 */
|
|
72
|
+
font-size: 1em; /* 2 */
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* Text-level semantics
|
|
76
|
+
========================================================================== */
|
|
77
|
+
/**
|
|
78
|
+
* Remove the gray background on active links in IE 10.
|
|
79
|
+
*/
|
|
80
|
+
a {
|
|
81
|
+
background-color: transparent;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* 1. Remove the bottom border in Chrome 57-
|
|
86
|
+
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
|
|
87
|
+
*/
|
|
88
|
+
abbr[title] {
|
|
89
|
+
border-bottom: none; /* 1 */
|
|
90
|
+
text-decoration: underline; /* 2 */
|
|
91
|
+
text-decoration: underline dotted; /* 2 */
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Add the correct font weight in Chrome, Edge, and Safari.
|
|
96
|
+
*/
|
|
97
|
+
b,
|
|
98
|
+
strong {
|
|
99
|
+
font-weight: bolder;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* 1. Correct the inheritance and scaling of font size in all browsers.
|
|
104
|
+
* 2. Correct the odd `em` font sizing in all browsers.
|
|
105
|
+
*/
|
|
106
|
+
code,
|
|
107
|
+
kbd,
|
|
108
|
+
samp {
|
|
109
|
+
font-family: monospace, monospace; /* 1 */
|
|
110
|
+
font-size: 1em; /* 2 */
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Add the correct font size in all browsers.
|
|
115
|
+
*/
|
|
116
|
+
small {
|
|
117
|
+
font-size: 80%;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Prevent `sub` and `sup` elements from affecting the line height in
|
|
122
|
+
* all browsers.
|
|
123
|
+
*/
|
|
124
|
+
sub,
|
|
125
|
+
sup {
|
|
126
|
+
font-size: 75%;
|
|
127
|
+
line-height: 0;
|
|
128
|
+
position: relative;
|
|
129
|
+
vertical-align: baseline;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
sub {
|
|
133
|
+
bottom: -0.25em;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
sup {
|
|
137
|
+
top: -0.5em;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* Embedded content
|
|
141
|
+
========================================================================== */
|
|
142
|
+
/**
|
|
143
|
+
* Remove the border on images inside links in IE 10.
|
|
144
|
+
*/
|
|
145
|
+
img {
|
|
146
|
+
border-style: none;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/* Forms
|
|
150
|
+
========================================================================== */
|
|
151
|
+
/**
|
|
152
|
+
* 1. Change the font styles in all browsers.
|
|
153
|
+
* 2. Remove the margin in Firefox and Safari.
|
|
154
|
+
*/
|
|
155
|
+
button,
|
|
156
|
+
input,
|
|
157
|
+
optgroup,
|
|
158
|
+
select,
|
|
159
|
+
textarea {
|
|
160
|
+
font-family: inherit; /* 1 */
|
|
161
|
+
font-size: 100%; /* 1 */
|
|
162
|
+
line-height: 1.15; /* 1 */
|
|
163
|
+
margin: 0; /* 2 */
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Show the overflow in IE.
|
|
168
|
+
* 1. Show the overflow in Edge.
|
|
169
|
+
*/
|
|
170
|
+
button,
|
|
171
|
+
input {
|
|
172
|
+
/* 1 */
|
|
173
|
+
overflow: visible;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Remove the inheritance of text transform in Edge, Firefox, and IE.
|
|
178
|
+
* 1. Remove the inheritance of text transform in Firefox.
|
|
179
|
+
*/
|
|
180
|
+
button,
|
|
181
|
+
select {
|
|
182
|
+
/* 1 */
|
|
183
|
+
text-transform: none;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Correct the inability to style clickable types in iOS and Safari.
|
|
188
|
+
*/
|
|
189
|
+
button,
|
|
190
|
+
[type=button],
|
|
191
|
+
[type=reset],
|
|
192
|
+
[type=submit] {
|
|
193
|
+
-webkit-appearance: button;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Remove the inner border and padding in Firefox.
|
|
198
|
+
*/
|
|
199
|
+
button::-moz-focus-inner,
|
|
200
|
+
[type=button]::-moz-focus-inner,
|
|
201
|
+
[type=reset]::-moz-focus-inner,
|
|
202
|
+
[type=submit]::-moz-focus-inner {
|
|
203
|
+
border-style: none;
|
|
204
|
+
padding: 0;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Restore the focus styles unset by the previous rule.
|
|
209
|
+
*/
|
|
210
|
+
button:-moz-focusring,
|
|
211
|
+
[type=button]:-moz-focusring,
|
|
212
|
+
[type=reset]:-moz-focusring,
|
|
213
|
+
[type=submit]:-moz-focusring {
|
|
214
|
+
outline: 1px dotted ButtonText;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Correct the padding in Firefox.
|
|
219
|
+
*/
|
|
220
|
+
fieldset {
|
|
221
|
+
padding: 0.35em 0.75em 0.625em;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* 1. Correct the text wrapping in Edge and IE.
|
|
226
|
+
* 2. Correct the color inheritance from `fieldset` elements in IE.
|
|
227
|
+
* 3. Remove the padding so developers are not caught out when they zero out
|
|
228
|
+
* `fieldset` elements in all browsers.
|
|
229
|
+
*/
|
|
230
|
+
legend {
|
|
231
|
+
box-sizing: border-box; /* 1 */
|
|
232
|
+
color: inherit; /* 2 */
|
|
233
|
+
display: table; /* 1 */
|
|
234
|
+
max-width: 100%; /* 1 */
|
|
235
|
+
padding: 0; /* 3 */
|
|
236
|
+
white-space: normal; /* 1 */
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
|
|
241
|
+
*/
|
|
242
|
+
progress {
|
|
243
|
+
vertical-align: baseline;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Remove the default vertical scrollbar in IE 10+.
|
|
248
|
+
*/
|
|
249
|
+
textarea {
|
|
250
|
+
overflow: auto;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* 1. Add the correct box sizing in IE 10.
|
|
255
|
+
* 2. Remove the padding in IE 10.
|
|
256
|
+
*/
|
|
257
|
+
[type=checkbox],
|
|
258
|
+
[type=radio] {
|
|
259
|
+
box-sizing: border-box; /* 1 */
|
|
260
|
+
padding: 0; /* 2 */
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Correct the cursor style of increment and decrement buttons in Chrome.
|
|
265
|
+
*/
|
|
266
|
+
[type=number]::-webkit-inner-spin-button,
|
|
267
|
+
[type=number]::-webkit-outer-spin-button {
|
|
268
|
+
height: auto;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* 1. Correct the odd appearance in Chrome and Safari.
|
|
273
|
+
* 2. Correct the outline style in Safari.
|
|
274
|
+
*/
|
|
275
|
+
[type=search] {
|
|
276
|
+
-webkit-appearance: textfield; /* 1 */
|
|
277
|
+
outline-offset: -2px; /* 2 */
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* Remove the inner padding in Chrome and Safari on macOS.
|
|
282
|
+
*/
|
|
283
|
+
[type=search]::-webkit-search-decoration {
|
|
284
|
+
-webkit-appearance: none;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* 1. Correct the inability to style clickable types in iOS and Safari.
|
|
289
|
+
* 2. Change font properties to `inherit` in Safari.
|
|
290
|
+
*/
|
|
291
|
+
::-webkit-file-upload-button {
|
|
292
|
+
-webkit-appearance: button; /* 1 */
|
|
293
|
+
font: inherit; /* 2 */
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/* Interactive
|
|
297
|
+
========================================================================== */
|
|
298
|
+
/*
|
|
299
|
+
* Add the correct display in Edge, IE 10+, and Firefox.
|
|
300
|
+
*/
|
|
301
|
+
details {
|
|
302
|
+
display: block;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/*
|
|
306
|
+
* Add the correct display in all browsers.
|
|
307
|
+
*/
|
|
308
|
+
summary {
|
|
309
|
+
display: list-item;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/* Misc
|
|
313
|
+
========================================================================== */
|
|
314
|
+
/**
|
|
315
|
+
* Add the correct display in IE 10+.
|
|
316
|
+
*/
|
|
317
|
+
template {
|
|
318
|
+
display: none;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Add the correct display in IE 10.
|
|
323
|
+
*/
|
|
324
|
+
[hidden] {
|
|
325
|
+
display: none;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
:root {
|
|
329
|
+
--spw-ds-container-xl: 1200px;
|
|
330
|
+
--spw-ds-container-lg: 1024px;
|
|
331
|
+
--spw-ds-container-md: 768px;
|
|
332
|
+
--spw-ds-container-sm: 640px;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.spw-ds-container {
|
|
336
|
+
width: 100%;
|
|
337
|
+
padding-left: 16px;
|
|
338
|
+
padding-right: 16px;
|
|
339
|
+
margin-left: auto;
|
|
340
|
+
margin-right: auto;
|
|
341
|
+
}
|
|
342
|
+
@media (min-width: 360px) {
|
|
343
|
+
.spw-ds-container {
|
|
344
|
+
max-width: var(--spw-ds-container-sm);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
@media (min-width: 768px) {
|
|
348
|
+
.spw-ds-container {
|
|
349
|
+
max-width: var(--spw-ds-container-md);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
@media (min-width: 1024px) {
|
|
353
|
+
.spw-ds-container {
|
|
354
|
+
max-width: var(--spw-ds-container-lg);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
@media (min-width: 1200px) {
|
|
358
|
+
.spw-ds-container {
|
|
359
|
+
max-width: var(--spw-ds-container-xl);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
:host {
|
|
364
|
+
display: block;
|
|
365
|
+
/** @prop --spw-alert-font-size: Taille de police de l'alerte */
|
|
366
|
+
--spw-alert-font-size: 14px;
|
|
367
|
+
/** @prop --spw-alert-background-color: Couleur de fond de l'alerte */
|
|
368
|
+
--spw-alert-background-color: var(--spw-ds-primary);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
.spw-alert {
|
|
372
|
+
width: 100%;
|
|
373
|
+
padding-top: 24px;
|
|
374
|
+
padding-bottom: 24px;
|
|
375
|
+
background: var(--spw-alert-background-color);
|
|
376
|
+
color: var(--spw-ds-white);
|
|
377
|
+
font-size: var(--spw-alert-font-size);
|
|
378
|
+
}
|
|
379
|
+
.spw-alert__container {
|
|
380
|
+
display: flex;
|
|
381
|
+
flex-direction: column;
|
|
382
|
+
width: 100%;
|
|
383
|
+
padding-left: 16px;
|
|
384
|
+
padding-right: 16px;
|
|
385
|
+
margin-left: auto;
|
|
386
|
+
margin-right: auto;
|
|
387
|
+
}
|
|
388
|
+
@media (min-width: 360px) {
|
|
389
|
+
.spw-alert__container {
|
|
390
|
+
max-width: var(--spw-ds-container-sm);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
@media (min-width: 768px) {
|
|
394
|
+
.spw-alert__container {
|
|
395
|
+
max-width: var(--spw-ds-container-md);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
@media (min-width: 1024px) {
|
|
399
|
+
.spw-alert__container {
|
|
400
|
+
max-width: var(--spw-ds-container-lg);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
@media (min-width: 1200px) {
|
|
404
|
+
.spw-alert__container {
|
|
405
|
+
max-width: var(--spw-ds-container-xl);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
.spw-alert__title-container {
|
|
409
|
+
display: flex;
|
|
410
|
+
align-items: center;
|
|
411
|
+
gap: 16px;
|
|
412
|
+
flex-wrap: nowrap;
|
|
413
|
+
flex-direction: row;
|
|
414
|
+
justify-content: space-between;
|
|
415
|
+
}
|
|
416
|
+
.spw-alert__title {
|
|
417
|
+
font-size: 16px;
|
|
418
|
+
flex: 1;
|
|
419
|
+
display: block;
|
|
420
|
+
}
|
|
421
|
+
.spw-alert__text {
|
|
422
|
+
color: var(--spw-ds-white);
|
|
423
|
+
margin-top: 12px;
|
|
424
|
+
line-height: 1.4;
|
|
425
|
+
}
|
|
426
|
+
.spw-alert__text--hidden {
|
|
427
|
+
display: none;
|
|
428
|
+
margin-top: 0;
|
|
429
|
+
}
|
|
430
|
+
.spw-alert spw-link {
|
|
431
|
+
font-size: 14px;
|
|
432
|
+
--spw-link-color: var(--spw-ds-white);
|
|
433
|
+
--spw-link-hover-color: var(--spw-ds-white);
|
|
434
|
+
--spw-link-active-color: var(--spw-ds-white);
|
|
435
|
+
--spw-link-padding: 8px;
|
|
436
|
+
}
|
|
437
|
+
.spw-alert spw-link:focus-visible {
|
|
438
|
+
outline: 3px solid white;
|
|
439
|
+
outline-offset: 0;
|
|
440
|
+
box-shadow: 0 0 0 6px black;
|
|
441
|
+
}
|
|
442
|
+
@media (max-width: 1023px) {
|
|
443
|
+
.spw-alert spw-link .spw-alert__close-text {
|
|
444
|
+
display: none;
|
|
445
|
+
}
|
|
446
|
+
}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
export class SpwAlert {
|
|
3
|
+
constructor() {
|
|
4
|
+
/** Si l'alerte est masquable */
|
|
5
|
+
this.isDismissable = true;
|
|
6
|
+
/** Texte du bouton pour masquer l'alerte */
|
|
7
|
+
this.dismissableText = 'Masquer';
|
|
8
|
+
/** Titre de l'alerte */
|
|
9
|
+
this.alertTitle = 'Notification';
|
|
10
|
+
this.isVisible = true;
|
|
11
|
+
this.hasSlotContent = false;
|
|
12
|
+
this.handleKeyDown = (ev) => {
|
|
13
|
+
if (ev.key === 'Enter') {
|
|
14
|
+
ev.preventDefault();
|
|
15
|
+
this.handleDismiss();
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
this.handleDismiss = () => {
|
|
19
|
+
this.spwDismiss.emit({ alertId: this.alertId });
|
|
20
|
+
this.isVisible = false;
|
|
21
|
+
};
|
|
22
|
+
this.handleSlotChange = () => {
|
|
23
|
+
if (this.slotElement) {
|
|
24
|
+
const assignedNodes = this.slotElement.assignedNodes({ flatten: true });
|
|
25
|
+
this.hasSlotContent = assignedNodes.some(node => { var _a; return node.nodeType === Node.ELEMENT_NODE || (node.nodeType === Node.TEXT_NODE && ((_a = node.textContent) === null || _a === void 0 ? void 0 : _a.trim()) !== ''); });
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Affiche l'alerte
|
|
31
|
+
*/
|
|
32
|
+
async showAlert() {
|
|
33
|
+
this.isVisible = true;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Masque l'alerte
|
|
37
|
+
*/
|
|
38
|
+
async hideAlert() {
|
|
39
|
+
this.isVisible = false;
|
|
40
|
+
}
|
|
41
|
+
render() {
|
|
42
|
+
return this.isVisible ? (h(Host, null, h("div", { class: "spw-alert", role: "alert", "aria-live": "polite", "aria-label": this.alertTitle }, h("div", { class: "spw-alert__container" }, h("div", { class: "spw-alert__title-container" }, h("strong", { class: "spw-alert__title" }, this.alertTitle), this.isDismissable && (h("spw-link", { tabindex: "0", icon: "fa-close", class: "spw-alert__close", "aria-label": this.dismissableText, onClick: this.handleDismiss, onKeyDown: this.handleKeyDown }, h("span", { class: "spw-alert__close-text" }, this.dismissableText)))), h("div", { class: { 'spw-alert__text': true, 'spw-alert__text--hidden': !this.hasSlotContent } }, h("slot", { ref: el => (this.slotElement = el), onSlotchange: this.handleSlotChange })))))) : null;
|
|
43
|
+
}
|
|
44
|
+
static get is() { return "spw-alert"; }
|
|
45
|
+
static get encapsulation() { return "shadow"; }
|
|
46
|
+
static get originalStyleUrls() {
|
|
47
|
+
return {
|
|
48
|
+
"$": ["spw-alert.scss"]
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
static get styleUrls() {
|
|
52
|
+
return {
|
|
53
|
+
"$": ["spw-alert.css"]
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
static get properties() {
|
|
57
|
+
return {
|
|
58
|
+
"alertId": {
|
|
59
|
+
"type": "string",
|
|
60
|
+
"mutable": false,
|
|
61
|
+
"complexType": {
|
|
62
|
+
"original": "string",
|
|
63
|
+
"resolved": "string",
|
|
64
|
+
"references": {}
|
|
65
|
+
},
|
|
66
|
+
"required": false,
|
|
67
|
+
"optional": false,
|
|
68
|
+
"docs": {
|
|
69
|
+
"tags": [],
|
|
70
|
+
"text": "Identifiant unique pour l'alerte"
|
|
71
|
+
},
|
|
72
|
+
"getter": false,
|
|
73
|
+
"setter": false,
|
|
74
|
+
"reflect": false,
|
|
75
|
+
"attribute": "alert-id"
|
|
76
|
+
},
|
|
77
|
+
"isDismissable": {
|
|
78
|
+
"type": "boolean",
|
|
79
|
+
"mutable": false,
|
|
80
|
+
"complexType": {
|
|
81
|
+
"original": "boolean",
|
|
82
|
+
"resolved": "boolean",
|
|
83
|
+
"references": {}
|
|
84
|
+
},
|
|
85
|
+
"required": false,
|
|
86
|
+
"optional": false,
|
|
87
|
+
"docs": {
|
|
88
|
+
"tags": [],
|
|
89
|
+
"text": "Si l'alerte est masquable"
|
|
90
|
+
},
|
|
91
|
+
"getter": false,
|
|
92
|
+
"setter": false,
|
|
93
|
+
"reflect": false,
|
|
94
|
+
"attribute": "is-dismissable",
|
|
95
|
+
"defaultValue": "true"
|
|
96
|
+
},
|
|
97
|
+
"dismissableText": {
|
|
98
|
+
"type": "string",
|
|
99
|
+
"mutable": false,
|
|
100
|
+
"complexType": {
|
|
101
|
+
"original": "string",
|
|
102
|
+
"resolved": "string",
|
|
103
|
+
"references": {}
|
|
104
|
+
},
|
|
105
|
+
"required": false,
|
|
106
|
+
"optional": false,
|
|
107
|
+
"docs": {
|
|
108
|
+
"tags": [],
|
|
109
|
+
"text": "Texte du bouton pour masquer l'alerte"
|
|
110
|
+
},
|
|
111
|
+
"getter": false,
|
|
112
|
+
"setter": false,
|
|
113
|
+
"reflect": false,
|
|
114
|
+
"attribute": "dismissable-text",
|
|
115
|
+
"defaultValue": "'Masquer'"
|
|
116
|
+
},
|
|
117
|
+
"alertTitle": {
|
|
118
|
+
"type": "string",
|
|
119
|
+
"mutable": false,
|
|
120
|
+
"complexType": {
|
|
121
|
+
"original": "string",
|
|
122
|
+
"resolved": "string",
|
|
123
|
+
"references": {}
|
|
124
|
+
},
|
|
125
|
+
"required": false,
|
|
126
|
+
"optional": false,
|
|
127
|
+
"docs": {
|
|
128
|
+
"tags": [],
|
|
129
|
+
"text": "Titre de l'alerte"
|
|
130
|
+
},
|
|
131
|
+
"getter": false,
|
|
132
|
+
"setter": false,
|
|
133
|
+
"reflect": false,
|
|
134
|
+
"attribute": "alert-title",
|
|
135
|
+
"defaultValue": "'Notification'"
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
static get states() {
|
|
140
|
+
return {
|
|
141
|
+
"isVisible": {},
|
|
142
|
+
"hasSlotContent": {}
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
static get events() {
|
|
146
|
+
return [{
|
|
147
|
+
"method": "spwDismiss",
|
|
148
|
+
"name": "spwDismiss",
|
|
149
|
+
"bubbles": true,
|
|
150
|
+
"cancelable": true,
|
|
151
|
+
"composed": true,
|
|
152
|
+
"docs": {
|
|
153
|
+
"tags": [],
|
|
154
|
+
"text": "\u00C9v\u00E9nement \u00E9mis lors du clic sur le bouton de fermeture"
|
|
155
|
+
},
|
|
156
|
+
"complexType": {
|
|
157
|
+
"original": "{ alertId: string }",
|
|
158
|
+
"resolved": "{ alertId: string; }",
|
|
159
|
+
"references": {}
|
|
160
|
+
}
|
|
161
|
+
}];
|
|
162
|
+
}
|
|
163
|
+
static get methods() {
|
|
164
|
+
return {
|
|
165
|
+
"showAlert": {
|
|
166
|
+
"complexType": {
|
|
167
|
+
"signature": "() => Promise<void>",
|
|
168
|
+
"parameters": [],
|
|
169
|
+
"references": {
|
|
170
|
+
"Promise": {
|
|
171
|
+
"location": "global",
|
|
172
|
+
"id": "global::Promise"
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
"return": "Promise<void>"
|
|
176
|
+
},
|
|
177
|
+
"docs": {
|
|
178
|
+
"text": "Affiche l'alerte",
|
|
179
|
+
"tags": []
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
"hideAlert": {
|
|
183
|
+
"complexType": {
|
|
184
|
+
"signature": "() => Promise<void>",
|
|
185
|
+
"parameters": [],
|
|
186
|
+
"references": {
|
|
187
|
+
"Promise": {
|
|
188
|
+
"location": "global",
|
|
189
|
+
"id": "global::Promise"
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
"return": "Promise<void>"
|
|
193
|
+
},
|
|
194
|
+
"docs": {
|
|
195
|
+
"text": "Masque l'alerte",
|
|
196
|
+
"tags": []
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
static get elementRef() { return "el"; }
|
|
202
|
+
}
|
|
@@ -760,7 +760,10 @@ export class SpwDatePicker {
|
|
|
760
760
|
const disabledDays = this.disabledDays;
|
|
761
761
|
if (disabledDays.includes(date.getDay()))
|
|
762
762
|
return true;
|
|
763
|
-
const
|
|
763
|
+
const year = date.getFullYear();
|
|
764
|
+
const month = `${date.getMonth() + 1}`.padStart(2, '0');
|
|
765
|
+
const day = `${date.getDate()}`.padStart(2, '0');
|
|
766
|
+
const dateStr = `${year}-${month}-${day}`;
|
|
764
767
|
const disabledDates = this.disabledDates;
|
|
765
768
|
return disabledDates.includes(dateStr);
|
|
766
769
|
},
|
|
@@ -926,7 +929,7 @@ export class SpwDatePicker {
|
|
|
926
929
|
'spw-date-picker--is-clear': this.isClearIconVisible,
|
|
927
930
|
};
|
|
928
931
|
const errorMessage = this.error || this.internalError;
|
|
929
|
-
return (h(Host, { key: '
|
|
932
|
+
return (h(Host, { key: '4818fb48fa99134c860fe3293ace2b162f143df6' }, h("div", { key: '2fb7d4b769e5ff1789dc40e53694e23ca947343a', class: containerClass }, this.label && (h("spw-field-label", { key: 'c984be1c9c8b7630019edb3078ee1f77334b8bc6', label: this.label, required: this.required, tooltipTitle: this.tooltipTitle, tooltipText: this.tooltipText, tooltipMaxWidth: this.tooltipMaxWidth, tooltipDirection: this.tooltipDirection, tooltipCursor: this.tooltipCursor })), this.assistiveText && (h("spw-field-message", { key: 'e5308400ce270a89e06c5c47117d03ee652a4d86', class: "spw-date-picker__field-message", variant: "hint", showIcon: false }, this.assistiveText)), h("div", { key: '35cfbc344a26d8283eb4ace08377d16651187960', class: "spw-date-picker__input-container" }, h("input", { key: 'f3ea1407cff3e43c6aa15e9480f66a9325b1136a', ref: el => (this.inputElement = el), id: this.uniqueId, type: "text", class: inputClass, value: this.internalValue, placeholder: this.placeholder, disabled: this.disabled, required: this.required, onFocus: this.handleInputFocus, onInput: this.handleInputChange, onKeyDown: this.handleKeyDown, "aria-label": this.accAriaLabel || this.label || this.name, "aria-describedby": this.assistiveText || errorMessage ? `${this.uniqueId}-help ${this.uniqueId}-error` : undefined, "aria-invalid": this.hasError }), h("div", { key: '501bf33de48ef38ab6f7e8d63b2ac00a34fefdc6', class: "spw-date-picker__icons" }, this.isClearIconVisible && (h("span", { key: '06ecd72a6dd552aa8353790b3dbb606b0f57ac93', class: "spw-date-picker__clear", onClick: this.handleClear }, h("spw-icon", { key: '6537617b36f45e1d0c351f2b2f1859d23ddd4508', class: "spw-date-picker__icon spw-date-picker__icon--clear", icon: "fa-xmark" }))), h("span", { key: '9f9a60c823d08bea01784882452d7f172e4d442c', class: "spw-date-picker__calendar-trigger", onMouseDown: this.handleCalendarIconMouseDown, onClick: this.handleCalendarIconClick }, h("spw-icon", { key: 'dcbbde1aa7b09c2c5b75d8d5b94a020c930b037e', icon: "fa-calendar", variant: "fa-regular", class: "spw-date-picker__icon spw-date-picker__icon--calendar" })))), this.renderMessages())));
|
|
930
933
|
}
|
|
931
934
|
static get is() { return "spw-date-picker"; }
|
|
932
935
|
static get encapsulation() { return "shadow"; }
|