@supersoniks/concorde 1.1.42 → 1.1.43
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/components.js +2 -3
- package/concorde-core.bundle.js +37 -35
- package/concorde-core.es.js +5081 -4317
- package/core/_types/types.d.ts +26 -0
- package/core/_types/types.js +1 -0
- package/core/components/functional/date/date.d.ts +13 -5
- package/core/components/functional/date/date.js +48 -29
- package/core/components/functional/example/example.d.ts +1 -1
- package/core/components/functional/example/example.js +1 -1
- package/core/components/functional/fetch/fetch.d.ts +40 -3
- package/core/components/functional/fetch/fetch.js +2 -6
- package/core/components/functional/functional.d.ts +2 -0
- package/core/components/functional/functional.js +2 -0
- package/core/components/functional/if/if.d.ts +3 -0
- package/core/components/functional/if/if.js +6 -12
- package/core/components/functional/if/if.test.d.ts +1 -0
- package/core/components/functional/if/if.test.js +44 -0
- package/core/components/functional/list/list.d.ts +32 -8
- package/core/components/functional/list/list.js +33 -40
- package/core/components/functional/mix/mix.d.ts +22 -0
- package/core/components/functional/mix/mix.js +99 -0
- package/core/components/functional/queue/queue.d.ts +16 -3
- package/core/components/functional/queue/queue.js +71 -15
- package/core/components/functional/router/redirect.d.ts +10 -1
- package/core/components/functional/router/redirect.js +5 -6
- package/core/components/functional/router/router.d.ts +15 -1
- package/core/components/functional/router/router.js +1 -6
- package/core/components/functional/sdui/SDUIDescriptorTransformer.d.ts +1 -1
- package/core/components/functional/sdui/SDUIDescriptorTransformer.js +24 -12
- package/core/components/functional/sdui/default-library.json +108 -0
- package/core/components/functional/sdui/sdui-utils.d.ts +5 -0
- package/core/components/functional/sdui/sdui-utils.js +63 -0
- package/core/components/functional/sdui/sdui.d.ts +16 -9
- package/core/components/functional/sdui/sdui.js +52 -25
- package/core/components/functional/sdui/types.d.ts +4 -2
- package/core/components/functional/states/states.d.ts +19 -3
- package/core/components/functional/states/states.js +7 -12
- package/core/components/functional/submit/submit.d.ts +16 -1
- package/core/components/functional/submit/submit.js +87 -17
- package/core/components/functional/subscriber/subscriber.d.ts +4 -1
- package/core/components/functional/subscriber/subscriber.js +1 -6
- package/core/components/functional/value/value.d.ts +7 -0
- package/core/components/functional/value/value.js +26 -0
- package/core/components/ui/_css/scroll.js +6 -7
- package/core/components/ui/_css/size.d.ts +1 -0
- package/core/components/ui/_css/size.js +3 -1
- package/core/components/ui/alert/alert.d.ts +2 -2
- package/core/components/ui/alert/alert.js +11 -16
- package/core/components/ui/badge/badge.d.ts +3 -1
- package/core/components/ui/badge/badge.js +36 -22
- package/core/components/ui/button/button.d.ts +23 -20
- package/core/components/ui/button/button.js +59 -42
- package/core/components/ui/captcha/captcha.d.ts +14 -2
- package/core/components/ui/captcha/captcha.js +17 -12
- package/core/components/ui/card/card-footer.js +1 -8
- package/core/components/ui/card/card-header-descripton.js +3 -9
- package/core/components/ui/card/card-header.js +1 -6
- package/core/components/ui/card/card-main.js +0 -5
- package/core/components/ui/card/card.d.ts +1 -1
- package/core/components/ui/card/card.js +28 -12
- package/core/components/ui/divider/divider.d.ts +2 -0
- package/core/components/ui/divider/divider.js +43 -16
- package/core/components/ui/form/checkbox/checkbox.d.ts +53 -16
- package/core/components/ui/form/checkbox/checkbox.js +53 -28
- package/core/components/ui/form/css/form-control.d.ts +2 -0
- package/core/components/ui/form/css/form-control.js +145 -67
- package/core/components/ui/form/fieldset/fieldset.d.ts +8 -1
- package/core/components/ui/form/fieldset/fieldset.js +45 -8
- package/core/components/ui/form/fieldset/legend-description.js +0 -5
- package/core/components/ui/form/fieldset/legend.js +3 -6
- package/core/components/ui/form/form-actions/form-actions.d.ts +2 -0
- package/core/components/ui/form/form-actions/form-actions.js +26 -11
- package/core/components/ui/form/form-layout/form-layout.d.ts +5 -2
- package/core/components/ui/form/form-layout/form-layout.js +31 -9
- package/core/components/ui/form/input/input.d.ts +15 -18
- package/core/components/ui/form/input/input.js +87 -52
- package/core/components/ui/form/input/password-helper.d.ts +1 -1
- package/core/components/ui/form/input/password-helper.js +3 -2
- package/core/components/ui/form/input/same-value-helper.d.ts +1 -1
- package/core/components/ui/form/input/same-value-helper.js +1 -0
- package/core/components/ui/form/input-autocomplete/input-autocomplete.d.ts +2 -3
- package/core/components/ui/form/input-autocomplete/input-autocomplete.js +2 -6
- package/core/components/ui/form/radio/radio.d.ts +6 -0
- package/core/components/ui/form/radio/radio.js +7 -12
- package/core/components/ui/form/select/select.d.ts +23 -7
- package/core/components/ui/form/select/select.js +69 -38
- package/core/components/ui/form/textarea/textarea.d.ts +13 -13
- package/core/components/ui/form/textarea/textarea.js +29 -36
- package/core/components/ui/group/group.d.ts +11 -1
- package/core/components/ui/group/group.js +79 -17
- package/core/components/ui/icon/icon.d.ts +10 -3
- package/core/components/ui/icon/icon.js +16 -15
- package/core/components/ui/icon/icons.js +11 -8
- package/core/components/ui/icon/icons.json +1 -1
- package/core/components/ui/image/image.js +0 -5
- package/core/components/ui/link/link.d.ts +1 -1
- package/core/components/ui/link/link.js +2 -6
- package/core/components/ui/loader/loader.js +2 -8
- package/core/components/ui/menu/menu-item.js +4 -9
- package/core/components/ui/menu/menu.d.ts +9 -1
- package/core/components/ui/menu/menu.js +183 -27
- package/core/components/ui/modal/modal-actions.js +1 -6
- package/core/components/ui/modal/modal-close.d.ts +1 -0
- package/core/components/ui/modal/modal-close.js +14 -10
- package/core/components/ui/modal/modal-content.js +0 -5
- package/core/components/ui/modal/modal-subtitle.js +2 -6
- package/core/components/ui/modal/modal-title.js +0 -5
- package/core/components/ui/modal/modal.d.ts +7 -7
- package/core/components/ui/modal/modal.js +36 -36
- package/core/components/ui/pop/pop.d.ts +6 -5
- package/core/components/ui/pop/pop.js +44 -44
- package/core/components/ui/progress/progress.js +34 -32
- package/core/components/ui/table/table-caption.js +5 -10
- package/core/components/ui/table/table-tbody.js +10 -14
- package/core/components/ui/table/table-td.d.ts +2 -0
- package/core/components/ui/table/table-td.js +8 -5
- package/core/components/ui/table/table-tfoot.js +5 -7
- package/core/components/ui/table/table-th.d.ts +2 -0
- package/core/components/ui/table/table-th.js +12 -9
- package/core/components/ui/table/table-thead.js +1 -6
- package/core/components/ui/table/table-tr.js +4 -6
- package/core/components/ui/table/table.d.ts +0 -3
- package/core/components/ui/table/table.js +14 -31
- package/core/components/ui/taxonomy/taxonomy.d.ts +6 -3
- package/core/components/ui/taxonomy/taxonomy.js +9 -9
- package/core/components/ui/theme/theme-collection/core-variables.js +13 -11
- package/core/components/ui/theme/theme-collection/dark.js +1 -1
- package/core/components/ui/theme/theme.d.ts +1 -6
- package/core/components/ui/theme/theme.js +7 -36
- package/core/components/ui/toast/message-subscriber.d.ts +13 -7
- package/core/components/ui/toast/toast-item.js +1 -1
- package/core/components/ui/toast/toast.d.ts +2 -1
- package/core/components/ui/toast/toast.js +29 -14
- package/core/components/ui/tooltip/tooltip.d.ts +1 -0
- package/core/components/ui/tooltip/tooltip.js +35 -14
- package/core/components/ui/ui.js +0 -3
- package/core/core.js +5 -6
- package/core/mixins/Fetcher.d.ts +19 -10
- package/core/mixins/Fetcher.js +26 -10
- package/core/mixins/FormCheckable.d.ts +17 -8
- package/core/mixins/FormCheckable.js +177 -22
- package/core/mixins/FormElement.d.ts +12 -7
- package/core/mixins/FormElement.js +42 -26
- package/core/mixins/FormInput.d.ts +8 -4
- package/core/mixins/FormInput.js +4 -3
- package/core/mixins/Subscriber.d.ts +7 -5
- package/core/mixins/Subscriber.js +34 -32
- package/core/utils/Arrays.d.ts +15 -15
- package/core/utils/DataBindObserver.d.ts +16 -9
- package/core/utils/DataBindObserver.js +23 -28
- package/core/utils/Electron.d.ts +5 -1
- package/core/utils/Electron.js +4 -2
- package/core/utils/HTML.d.ts +9 -2
- package/core/utils/HTML.js +22 -3
- package/core/utils/LocationHandler.d.ts +6 -5
- package/core/utils/LocationHandler.js +19 -8
- package/core/utils/Objects.d.ts +7 -4
- package/core/utils/Objects.js +28 -6
- package/core/utils/{PublisherProxy.d.mts → PublisherProxy.d.ts} +40 -31
- package/core/utils/{PublisherProxy.mjs → PublisherProxy.js} +54 -28
- package/core/utils/Utils.d.ts +3 -0
- package/core/utils/Utils.js +18 -0
- package/core/utils/api.d.ts +39 -7
- package/core/utils/api.js +45 -32
- package/img/concorde-logo.svg +1 -0
- package/img/concorde.png +0 -0
- package/img/concorde_def.png +0 -0
- package/mixins.d.ts +36 -18
- package/mixins.js +3 -4
- package/package.json +45 -10
- package/svg/regular/plane.svg +1 -0
- package/svg/solid/plane.svg +1 -0
- package/test-utils/TestUtils.d.ts +4 -0
- package/test-utils/TestUtils.js +12 -0
- package/utils.d.ts +3 -1
- package/utils.js +7 -5
- package/core/components/functional/configuration/configuration.d.ts +0 -5
- package/core/components/functional/configuration/configuration.js +0 -22
- package/core/components/ui/tabs/tab.d.ts +0 -6
- package/core/components/ui/tabs/tab.js +0 -46
- package/core/components/ui/tabs/tabs.d.ts +0 -15
- package/core/components/ui/tabs/tabs.js +0 -129
|
@@ -13,7 +13,8 @@ import FormCheckable from "@supersoniks/concorde/core/mixins/FormCheckable";
|
|
|
13
13
|
import Subscriber from "@supersoniks/concorde/core/mixins/Subscriber";
|
|
14
14
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
15
15
|
import { fontSize } from "@supersoniks/concorde/core/components/ui/_css/size";
|
|
16
|
-
|
|
16
|
+
import { PublisherManager } from "@supersoniks/concorde/utils";
|
|
17
|
+
const tagName = "sonic-button";
|
|
17
18
|
/**
|
|
18
19
|
* Un bouton simple avec deux slots, un nommé préfix et un nomé suffix de manière à pouvoir mettre (par exemple) une icone avant ou après le contenu.
|
|
19
20
|
* * L'objet et ses slot sont en display flex avec direction / alignement et justifications configurables
|
|
@@ -54,15 +55,15 @@ let Button = class Button extends FormCheckable(FormElement(Subscriber(LitElemen
|
|
|
54
55
|
*/
|
|
55
56
|
this.minWidth = "0";
|
|
56
57
|
/**
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
* Si un bouton n'a qu'une icone pour contenu, agrandi l'icone pour des raisons d'équilibre
|
|
59
|
+
*/
|
|
59
60
|
this.icon = false;
|
|
60
61
|
/**
|
|
61
62
|
* mode d'activation du bouton :
|
|
62
63
|
* - strict : l'url courante match exactement avec le href du bouton
|
|
63
64
|
* - partial : l'url courante match à gauche avec le href du bouton
|
|
64
65
|
* - disabled : aucune activation / désactivation
|
|
65
|
-
|
|
66
|
+
*/
|
|
66
67
|
this.autoActive = "partial";
|
|
67
68
|
/**
|
|
68
69
|
* Laisse apparaitre un loader en remplacement du contenu du bouton.
|
|
@@ -103,23 +104,32 @@ let Button = class Button extends FormCheckable(FormElement(Subscriber(LitElemen
|
|
|
103
104
|
handleChange(e) {
|
|
104
105
|
super.handleChange(e);
|
|
105
106
|
if (this.pushState || this.goBack !== null) {
|
|
106
|
-
e.preventDefault();
|
|
107
|
-
e.stopPropagation();
|
|
107
|
+
e === null || e === void 0 ? void 0 : e.preventDefault();
|
|
108
|
+
e === null || e === void 0 ? void 0 : e.stopPropagation();
|
|
108
109
|
LocationHandler.changeFromComponent(this);
|
|
109
110
|
}
|
|
111
|
+
if (this.hasAttribute("reset")) {
|
|
112
|
+
/**
|
|
113
|
+
* On on veut pouvoir rest un autre form que celui qui contient le bouton
|
|
114
|
+
*/
|
|
115
|
+
const resetDataProvider = this.getAttribute("reset");
|
|
116
|
+
let formPublisher = resetDataProvider ? PublisherManager.get(resetDataProvider) : this.getFormPublisher();
|
|
117
|
+
if (formPublisher)
|
|
118
|
+
formPublisher.set({});
|
|
119
|
+
}
|
|
110
120
|
}
|
|
111
121
|
connectedCallback() {
|
|
112
122
|
super.connectedCallback();
|
|
113
123
|
}
|
|
114
124
|
setCheckedValue(checked) {
|
|
115
125
|
if (this.name) {
|
|
116
|
-
if (checked
|
|
117
|
-
return;
|
|
118
|
-
super.setCheckedValue(checked);
|
|
119
|
-
if (this._checked)
|
|
126
|
+
if (checked)
|
|
120
127
|
this.setAttribute("active", "true");
|
|
121
128
|
else
|
|
122
129
|
this.removeAttribute("active");
|
|
130
|
+
if (checked == this._checked)
|
|
131
|
+
return;
|
|
132
|
+
super.setCheckedValue(checked);
|
|
123
133
|
}
|
|
124
134
|
}
|
|
125
135
|
disconnectedCallback() {
|
|
@@ -138,11 +148,18 @@ let Button = class Button extends FormCheckable(FormElement(Subscriber(LitElemen
|
|
|
138
148
|
flexDirection: this.direction,
|
|
139
149
|
alignItems: this.alignItems,
|
|
140
150
|
justifyContent: this.justify,
|
|
141
|
-
|
|
151
|
+
align: this.align,
|
|
142
152
|
minWidth: this.minWidth,
|
|
143
153
|
};
|
|
144
154
|
const btn = html `
|
|
145
|
-
<button
|
|
155
|
+
<button
|
|
156
|
+
part="button"
|
|
157
|
+
class=${this.hasPrefix || this.hasSuffix ? "has-prefix-or-suffix" : ""}
|
|
158
|
+
style=${styleMap(btnStyles)}
|
|
159
|
+
aria-label=${ifDefined(this.ariaLabel)}
|
|
160
|
+
aria-labelledby=${ifDefined(this.ariaLabelledby)}
|
|
161
|
+
@click=${this.handleChange}
|
|
162
|
+
>
|
|
146
163
|
<slot @slotchange=${this.onSlotChange} part="prefix" name="prefix"></slot>
|
|
147
164
|
<slot part="main" class="main-slot"></slot>
|
|
148
165
|
<slot @slotchange=${this.onSlotChange} part="suffix" name="suffix"></slot>
|
|
@@ -150,7 +167,14 @@ let Button = class Button extends FormCheckable(FormElement(Subscriber(LitElemen
|
|
|
150
167
|
</button>
|
|
151
168
|
`;
|
|
152
169
|
return this.href
|
|
153
|
-
? html `<a
|
|
170
|
+
? html `<a
|
|
171
|
+
href="${this.href}"
|
|
172
|
+
target=${ifDefined(this.target)}
|
|
173
|
+
aria-label=${ifDefined(this.ariaLabel)}
|
|
174
|
+
aria-labelledby=${ifDefined(this.ariaLabelledby)}
|
|
175
|
+
@click=${this.pushState || this.goBack !== null ? this.handleNavigation : null}
|
|
176
|
+
>${btn}</a
|
|
177
|
+
>`
|
|
154
178
|
: html `${btn}`;
|
|
155
179
|
}
|
|
156
180
|
onSlotChange() {
|
|
@@ -197,11 +221,12 @@ Button.styles = [
|
|
|
197
221
|
display: inline-flex;
|
|
198
222
|
vertical-align: middle;
|
|
199
223
|
box-sizing: border-box;
|
|
224
|
+
-webkit-print-color-adjust: exact;
|
|
200
225
|
}
|
|
201
226
|
|
|
202
227
|
:host a {
|
|
203
228
|
display: contents;
|
|
204
|
-
color:unset;
|
|
229
|
+
color: unset;
|
|
205
230
|
}
|
|
206
231
|
|
|
207
232
|
:host button {
|
|
@@ -219,7 +244,7 @@ Button.styles = [
|
|
|
219
244
|
text-align: center;
|
|
220
245
|
line-height: 1.1;
|
|
221
246
|
border-radius: var(--sc-item-rounded-tl) var(--sc-item-rounded-tr) var(--sc-item-rounded-br)
|
|
222
|
-
|
|
247
|
+
var(--sc-item-rounded-bl);
|
|
223
248
|
|
|
224
249
|
background: var(--sc-btn-bg);
|
|
225
250
|
color: var(--sc-btn-color);
|
|
@@ -277,13 +302,14 @@ Button.styles = [
|
|
|
277
302
|
--sc-btn-bg: var(--sc-base-600);
|
|
278
303
|
}
|
|
279
304
|
|
|
280
|
-
|
|
281
305
|
/*UNSTYLED*/
|
|
282
|
-
:host([variant="unstyled"])
|
|
306
|
+
:host([variant="unstyled"]) {
|
|
307
|
+
display: inline-block;
|
|
308
|
+
}
|
|
309
|
+
|
|
283
310
|
:host([variant="unstyled"]) button {
|
|
284
311
|
all: unset;
|
|
285
312
|
display: contents;
|
|
286
|
-
transition: 0.1s;
|
|
287
313
|
cursor: pointer;
|
|
288
314
|
--sc-btn-height: auto;
|
|
289
315
|
--sc-btn-width: auto;
|
|
@@ -343,8 +369,8 @@ Button.styles = [
|
|
|
343
369
|
/*OUTLINE*/
|
|
344
370
|
:host([variant="link"]:not([size])) {
|
|
345
371
|
vertical-align: baseline;
|
|
346
|
-
margin-left
|
|
347
|
-
margin-right
|
|
372
|
+
margin-left: 0.25em;
|
|
373
|
+
margin-right: 0.25em;
|
|
348
374
|
}
|
|
349
375
|
|
|
350
376
|
:host([variant="link"]:not([size])) {
|
|
@@ -386,7 +412,7 @@ Button.styles = [
|
|
|
386
412
|
padding: 0;
|
|
387
413
|
align-items: center;
|
|
388
414
|
justify-content: 0;
|
|
389
|
-
text-align:center !important;
|
|
415
|
+
text-align: center !important;
|
|
390
416
|
}
|
|
391
417
|
|
|
392
418
|
:host([shape="block"]),
|
|
@@ -401,29 +427,28 @@ Button.styles = [
|
|
|
401
427
|
}
|
|
402
428
|
|
|
403
429
|
/*ACTIVE*/
|
|
404
|
-
|
|
430
|
+
|
|
431
|
+
:host([active]:not([variant="ghost"]):not([variant="unstyled"])) button {
|
|
405
432
|
background: var(--sc-btn-active-bg);
|
|
406
433
|
color: var(--sc-btn-active-color);
|
|
407
434
|
border-color: var(--sc-btn-active-bg);
|
|
408
435
|
}
|
|
409
436
|
|
|
410
|
-
:host([
|
|
437
|
+
:host([align="left"]) button {
|
|
411
438
|
text-align: left;
|
|
412
439
|
}
|
|
413
440
|
|
|
414
|
-
:host([
|
|
441
|
+
:host([align="right"]) button {
|
|
415
442
|
text-align: right;
|
|
416
443
|
}
|
|
417
444
|
|
|
418
445
|
.main-slot {
|
|
419
446
|
flex-grow: 1;
|
|
420
447
|
display: block;
|
|
421
|
-
/*align-items: center;
|
|
422
|
-
justify-content: center;*/
|
|
423
448
|
}
|
|
424
449
|
|
|
425
450
|
:host([minWidth]) .main-slot {
|
|
426
|
-
flex-grow:0;
|
|
451
|
+
flex-grow: 0;
|
|
427
452
|
}
|
|
428
453
|
|
|
429
454
|
slot[name="suffix"],
|
|
@@ -435,17 +460,15 @@ Button.styles = [
|
|
|
435
460
|
permet de tous les avoir alignés dans un menu
|
|
436
461
|
*/
|
|
437
462
|
::slotted(sonic-icon) {
|
|
438
|
-
min-width:
|
|
463
|
+
min-width: 1em;
|
|
439
464
|
text-align: center;
|
|
440
465
|
}
|
|
441
466
|
|
|
442
|
-
|
|
443
|
-
/*BOUTON Avec icone seulement*/
|
|
467
|
+
/*BOUTON Avec icone seulement*/
|
|
444
468
|
:host([icon]) ::slotted(sonic-icon) {
|
|
445
|
-
font-size: 1.
|
|
469
|
+
font-size: 1.2em;
|
|
446
470
|
}
|
|
447
471
|
|
|
448
|
-
|
|
449
472
|
/*Tooltip ne joue pas sur le layout*/
|
|
450
473
|
sonic-tooltip {
|
|
451
474
|
display: contents;
|
|
@@ -453,11 +476,11 @@ Button.styles = [
|
|
|
453
476
|
|
|
454
477
|
/*OUTLINE*/
|
|
455
478
|
:host(:not([active])) ::slotted([swap="on"]) {
|
|
456
|
-
display: none;
|
|
479
|
+
display: none !important;
|
|
457
480
|
}
|
|
458
481
|
|
|
459
482
|
:host([active]) ::slotted([swap="off"]) {
|
|
460
|
-
display: none;
|
|
483
|
+
display: none !important;
|
|
461
484
|
}
|
|
462
485
|
|
|
463
486
|
/*Loading*/
|
|
@@ -540,10 +563,10 @@ __decorate([
|
|
|
540
563
|
state()
|
|
541
564
|
], Button.prototype, "hasSuffix", void 0);
|
|
542
565
|
__decorate([
|
|
543
|
-
queryAssignedElements({ flatten: true, slot:
|
|
566
|
+
queryAssignedElements({ flatten: true, slot: "prefix" })
|
|
544
567
|
], Button.prototype, "prefixes", void 0);
|
|
545
568
|
__decorate([
|
|
546
|
-
queryAssignedElements({ flatten: true, slot:
|
|
569
|
+
queryAssignedElements({ flatten: true, slot: "suffix" })
|
|
547
570
|
], Button.prototype, "suffixes", void 0);
|
|
548
571
|
__decorate([
|
|
549
572
|
property({ type: String })
|
|
@@ -564,9 +587,3 @@ Button = __decorate([
|
|
|
564
587
|
customElement(tagName)
|
|
565
588
|
], Button);
|
|
566
589
|
export { Button };
|
|
567
|
-
//Ajout pour Storybook
|
|
568
|
-
try {
|
|
569
|
-
customElements.define(tagName, Button);
|
|
570
|
-
}
|
|
571
|
-
catch (e) { }
|
|
572
|
-
export const SonicButton = Button;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
|
-
declare
|
|
2
|
+
declare type AssignListener = {
|
|
3
|
+
onAssign: (listener: (value: string) => void) => void;
|
|
4
|
+
};
|
|
5
|
+
declare const Captcha_base: (new (...args: any[]) => import("../../../mixins/Subscriber").SubscriberInterface<any>) & typeof LitElement;
|
|
3
6
|
/**
|
|
4
7
|
* Un bouton simple avec deux slots, un nommé préfix et un nomé suffix de manière à pouvoir mettre (par exemple) une icone avant ou après le contenu.
|
|
5
8
|
* * L'objet et ses slot sont en display flex avec direction / alignement et justifications configurables
|
|
@@ -9,7 +12,16 @@ declare const Captcha_base: (new (...args: any[]) => import("../../../mixins/Sub
|
|
|
9
12
|
export declare class Captcha extends Captcha_base {
|
|
10
13
|
key: string;
|
|
11
14
|
action: string | null;
|
|
12
|
-
formPublisher
|
|
15
|
+
formPublisher?: {
|
|
16
|
+
needsCaptchaValidation: boolean;
|
|
17
|
+
captchaToken: string | AssignListener;
|
|
18
|
+
captchaMethod?: {
|
|
19
|
+
get: () => string;
|
|
20
|
+
};
|
|
21
|
+
captchaAction?: {
|
|
22
|
+
get: () => string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
13
25
|
connectedCallback(): void;
|
|
14
26
|
requestToken(): void;
|
|
15
27
|
protected render(): import("lit-html").TemplateResult<1>;
|
|
@@ -28,25 +28,30 @@ let Captcha = class Captcha extends Subscriber(LitElement) {
|
|
|
28
28
|
document.head.appendChild(script);
|
|
29
29
|
super.connectedCallback();
|
|
30
30
|
this.formPublisher = PublisherManager.get((_a = this.getAncestorAttributeValue("headersDataProvider")) !== null && _a !== void 0 ? _a : this.getAncestorAttributeValue("formDataProvider"));
|
|
31
|
-
this.formPublisher
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
if (this.formPublisher) {
|
|
32
|
+
this.formPublisher.needsCaptchaValidation = true;
|
|
33
|
+
this.formPublisher.captchaToken.onAssign((v) => {
|
|
34
|
+
if (v == "request_token") {
|
|
35
|
+
this.requestToken();
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
37
39
|
}
|
|
38
40
|
requestToken() {
|
|
39
|
-
var _a, _b, _c, _d;
|
|
40
|
-
|
|
41
|
+
var _a, _b, _c, _d, _e;
|
|
42
|
+
if (!this.formPublisher)
|
|
43
|
+
return;
|
|
41
44
|
// On récupère l'action liée au recaptcha,
|
|
42
45
|
// et on vérifie qu'il ne contienne que des caractères alpha-numériques, underscore et slash
|
|
43
46
|
let action = ((_c = (_a = this.action) !== null && _a !== void 0 ? _a : (_b = this.formPublisher.captchaAction) === null || _b === void 0 ? void 0 : _b.get()) !== null && _c !== void 0 ? _c : "submit").replace(/[^\w_\/]/g, "_");
|
|
44
|
-
let method = ((_d = this.formPublisher.captchaMethod.get()) !== null &&
|
|
47
|
+
let method = ((_e = (_d = this.formPublisher.captchaMethod) === null || _d === void 0 ? void 0 : _d.get()) !== null && _e !== void 0 ? _e : "POST").toUpperCase();
|
|
45
48
|
delete this.formPublisher.captchaAction;
|
|
46
49
|
delete this.formPublisher.captchaMethod;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
this.formPublisher
|
|
50
|
+
window.grecaptcha.ready(() => {
|
|
51
|
+
window.grecaptcha.execute(this.key, { action: method + "//" + action }).then((token) => {
|
|
52
|
+
if (this.formPublisher) {
|
|
53
|
+
this.formPublisher.captchaToken = token;
|
|
54
|
+
}
|
|
50
55
|
});
|
|
51
56
|
});
|
|
52
57
|
}
|
|
@@ -15,17 +15,10 @@ let CardFooter = class CardFooter extends LitElement {
|
|
|
15
15
|
// `
|
|
16
16
|
// ];
|
|
17
17
|
render() {
|
|
18
|
-
return html `
|
|
19
|
-
<slot></slot>
|
|
20
|
-
`;
|
|
18
|
+
return html ` <slot></slot> `;
|
|
21
19
|
}
|
|
22
20
|
};
|
|
23
21
|
CardFooter = __decorate([
|
|
24
22
|
customElement(tagName)
|
|
25
23
|
], CardFooter);
|
|
26
24
|
export { CardFooter };
|
|
27
|
-
//Ajout pour Storybook
|
|
28
|
-
try {
|
|
29
|
-
customElements.define(tagName, CardFooter);
|
|
30
|
-
}
|
|
31
|
-
catch (e) { }
|
|
@@ -18,21 +18,15 @@ let CardHeaderDescription = class CardHeaderDescription extends LitElement {
|
|
|
18
18
|
};
|
|
19
19
|
CardHeaderDescription.styles = [
|
|
20
20
|
css `
|
|
21
|
-
|
|
22
21
|
div {
|
|
23
|
-
margin-top: .1em;
|
|
22
|
+
margin-top: 0.1em;
|
|
24
23
|
font-family: var(--sc-font-family-base);
|
|
25
|
-
font-size: .7em;
|
|
24
|
+
font-size: 0.7em;
|
|
26
25
|
font-weight: var(--sc-font-style-base);
|
|
27
26
|
}
|
|
28
|
-
|
|
29
|
-
`
|
|
27
|
+
`,
|
|
30
28
|
];
|
|
31
29
|
CardHeaderDescription = __decorate([
|
|
32
30
|
customElement(tagName)
|
|
33
31
|
], CardHeaderDescription);
|
|
34
32
|
export { CardHeaderDescription };
|
|
35
|
-
try {
|
|
36
|
-
customElements.define(tagName, CardHeaderDescription);
|
|
37
|
-
}
|
|
38
|
-
catch (e) { }
|
|
@@ -28,7 +28,7 @@ let CardHeader = class CardHeader extends LitElement {
|
|
|
28
28
|
CardHeader.styles = [
|
|
29
29
|
css `
|
|
30
30
|
:host {
|
|
31
|
-
--sc-card-header-mb: 1.
|
|
31
|
+
--sc-card-header-mb: 1.35rem;
|
|
32
32
|
--sc-card-header-font-size: 1.875rem;
|
|
33
33
|
--sc-card-header-font-weight: var(--sc-headings-font-weight);
|
|
34
34
|
--sc-card-header-font-style: var(--sc-headings-font-style);
|
|
@@ -67,8 +67,3 @@ CardHeader = __decorate([
|
|
|
67
67
|
customElement(tagName)
|
|
68
68
|
], CardHeader);
|
|
69
69
|
export { CardHeader };
|
|
70
|
-
//Ajout pour Storybook
|
|
71
|
-
try {
|
|
72
|
-
customElements.define(tagName, CardHeader);
|
|
73
|
-
}
|
|
74
|
-
catch (e) { }
|
|
@@ -7,6 +7,6 @@ export declare class Card extends LitElement {
|
|
|
7
7
|
/**
|
|
8
8
|
* Le type change surtout la couleur composant
|
|
9
9
|
*/
|
|
10
|
-
type: "default" | "primary" | "warning" | "danger" | "success" | "info" | "neutral" | "invert";
|
|
10
|
+
type: "default" | "light" | "primary" | "warning" | "danger" | "success" | "info" | "neutral" | "invert";
|
|
11
11
|
render(): import("lit-html").TemplateResult<1>;
|
|
12
12
|
}
|
|
@@ -34,6 +34,17 @@ Card.styles = [
|
|
|
34
34
|
--sc-card-bg: var(--sc-base);
|
|
35
35
|
--sc-card-rounded: var(--sc-rounded-lg);
|
|
36
36
|
--sc-card-shadow: var(--sc-shadow-lg);
|
|
37
|
+
-webkit-print-color-adjust: exact;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@media print {
|
|
41
|
+
:host {
|
|
42
|
+
break-inside: avoid;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
* {
|
|
47
|
+
box-sizing: border-box;
|
|
37
48
|
}
|
|
38
49
|
|
|
39
50
|
.card {
|
|
@@ -46,34 +57,44 @@ Card.styles = [
|
|
|
46
57
|
|
|
47
58
|
/*TYPES*/
|
|
48
59
|
:host([type="primary"]) {
|
|
60
|
+
--sc-card-bg: var(--sc-primary);
|
|
49
61
|
--sc-card-color: var(--sc-primary-content);
|
|
50
|
-
--sc-
|
|
62
|
+
--sc-border-color: var(--sc-primary-content);
|
|
63
|
+
--sc-divider-opacity: 0.2;
|
|
51
64
|
}
|
|
52
65
|
:host([type="warning"]) {
|
|
53
|
-
--sc-card-color: var(--sc-warning-content);
|
|
54
66
|
--sc-card-bg: var(--sc-warning);
|
|
67
|
+
--sc-card-color: var(--sc-warning-content);
|
|
68
|
+
--sc-border-color: var(--sc-primary-content);
|
|
69
|
+
--sc-divider-opacity: 0.2;
|
|
55
70
|
}
|
|
56
71
|
:host([type="danger"]) {
|
|
57
|
-
--sc-card-color: var(--sc-danger-content);
|
|
58
72
|
--sc-card-bg: var(--sc-danger);
|
|
73
|
+
--sc-card-color: var(--sc-danger-content);
|
|
74
|
+
--sc-border-color: var(--sc-primary-content);
|
|
75
|
+
--sc-divider-opacity: 0.2;
|
|
59
76
|
}
|
|
60
77
|
:host([type="info"]) {
|
|
61
|
-
--sc-card-color: var(--sc-info-content);
|
|
62
78
|
--sc-card-bg: var(--sc-info);
|
|
79
|
+
--sc-card-color: var(--sc-info-content);
|
|
80
|
+
--sc-border-color: var(--sc-primary-content);
|
|
81
|
+
--sc-divider-opacity: 0.2;
|
|
63
82
|
}
|
|
64
83
|
:host([type="success"]) {
|
|
65
|
-
--sc-card-color: var(--sc-success-content);
|
|
66
84
|
--sc-card-bg: var(--sc-success);
|
|
85
|
+
--sc-card-color: var(--sc-success-content);
|
|
86
|
+
--sc-border-color: var(--sc-primary-content);
|
|
87
|
+
--sc-divider-opacity: 0.2;
|
|
67
88
|
}
|
|
68
89
|
|
|
69
90
|
:host([type="light"]) {
|
|
70
|
-
--sc-card-color: var(--sc-base-content);
|
|
71
91
|
--sc-card-bg: var(--sc-base-100);
|
|
92
|
+
--sc-card-color: var(--sc-base-content);
|
|
72
93
|
}
|
|
73
94
|
|
|
74
95
|
:host([type="neutral"]) {
|
|
75
|
-
--sc-card-color: var(--sc-base);
|
|
76
96
|
--sc-card-bg: var(--sc-base-content);
|
|
97
|
+
--sc-card-color: var(--sc-base);
|
|
77
98
|
}
|
|
78
99
|
|
|
79
100
|
:host([type="invert"]) {
|
|
@@ -89,8 +110,3 @@ Card = __decorate([
|
|
|
89
110
|
customElement(tagName)
|
|
90
111
|
], Card);
|
|
91
112
|
export { Card };
|
|
92
|
-
//Ajout pour Storybook
|
|
93
|
-
try {
|
|
94
|
-
customElements.define(tagName, Card);
|
|
95
|
-
}
|
|
96
|
-
catch (e) { }
|
|
@@ -6,6 +6,8 @@ export declare class Divider extends LitElement {
|
|
|
6
6
|
label: string;
|
|
7
7
|
size?: "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
8
8
|
align: "left" | "right" | "center";
|
|
9
|
+
vertical: boolean;
|
|
10
|
+
noMargin: boolean;
|
|
9
11
|
firstUpdated(): void;
|
|
10
12
|
render(): import("lit-html").TemplateResult<1>;
|
|
11
13
|
}
|
|
@@ -13,6 +13,8 @@ let Divider = class Divider extends LitElement {
|
|
|
13
13
|
super(...arguments);
|
|
14
14
|
this.label = "";
|
|
15
15
|
this.align = "center";
|
|
16
|
+
this.vertical = false;
|
|
17
|
+
this.noMargin = false;
|
|
16
18
|
}
|
|
17
19
|
firstUpdated() {
|
|
18
20
|
var _a, _b;
|
|
@@ -31,10 +33,10 @@ Divider.styles = [
|
|
|
31
33
|
:host {
|
|
32
34
|
--sc-divider-my: 0.5rem;
|
|
33
35
|
--sc-divider-mx: 0;
|
|
34
|
-
--sc-divider-border-width:
|
|
35
|
-
--sc-divider-border-color: var(--sc-
|
|
36
|
+
--sc-divider-border-width: max(1px, var(--sc-border-width));
|
|
37
|
+
--sc-divider-border-color: var(--sc-border-color);
|
|
36
38
|
--sc-divider-border-style: solid;
|
|
37
|
-
--sc-divider-color:
|
|
39
|
+
--sc-divider-color: currentColor;
|
|
38
40
|
--sc-divider-ff: var(--sc-font-family-base);
|
|
39
41
|
--sc-divider-fs: 1rem;
|
|
40
42
|
--sc-divider-fw: var(--sc-font-weight-base);
|
|
@@ -87,18 +89,13 @@ Divider.styles = [
|
|
|
87
89
|
width: 100%;
|
|
88
90
|
}
|
|
89
91
|
|
|
90
|
-
div
|
|
91
|
-
|
|
92
|
-
flex-grow: 1;
|
|
93
|
-
border-top: var(--sc-divider-border-width) var(--sc-divider-border-style) var(--sc-divider-border-color);
|
|
94
|
-
width: 100%;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
div:after {
|
|
92
|
+
div::before,
|
|
93
|
+
div::after {
|
|
98
94
|
content: "";
|
|
99
95
|
flex-grow: 1;
|
|
100
96
|
border-top: var(--sc-divider-border-width) var(--sc-divider-border-style) var(--sc-divider-border-color);
|
|
101
97
|
width: 100%;
|
|
98
|
+
opacity: var(--sc-divider-opacity, 1);
|
|
102
99
|
}
|
|
103
100
|
|
|
104
101
|
/*ALIGNEMENT*/
|
|
@@ -110,9 +107,37 @@ Divider.styles = [
|
|
|
110
107
|
display: none;
|
|
111
108
|
}
|
|
112
109
|
|
|
110
|
+
:host([vertical]) {
|
|
111
|
+
margin: var(--sc-divider-mx) var(--sc-divider-my);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
:host([vertical]) div {
|
|
115
|
+
flex-direction: column;
|
|
116
|
+
height: 100%;
|
|
117
|
+
min-height: var(--sc-form-height);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
:host([vertical]) .has-text {
|
|
121
|
+
gap: 0.25rem;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
:host([vertical]) div::before,
|
|
125
|
+
:host([vertical]) div::after {
|
|
126
|
+
border-top: none;
|
|
127
|
+
border-left: var(--sc-divider-border-width) var(--sc-divider-border-style) var(--sc-divider-border-color);
|
|
128
|
+
width: auto;
|
|
129
|
+
height: 100%;
|
|
130
|
+
opacity: var(--sc-divider-opacity, 1);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
:host([noMargin]) {
|
|
134
|
+
margin: 0;
|
|
135
|
+
}
|
|
136
|
+
|
|
113
137
|
/*TEXT*/
|
|
114
138
|
.text {
|
|
115
139
|
flex-shrink: 0;
|
|
140
|
+
line-height: 1.1;
|
|
116
141
|
max-width: 80%;
|
|
117
142
|
}
|
|
118
143
|
|
|
@@ -140,11 +165,13 @@ __decorate([
|
|
|
140
165
|
__decorate([
|
|
141
166
|
property({ type: String, reflect: true })
|
|
142
167
|
], Divider.prototype, "align", void 0);
|
|
168
|
+
__decorate([
|
|
169
|
+
property({ type: Boolean, reflect: true })
|
|
170
|
+
], Divider.prototype, "vertical", void 0);
|
|
171
|
+
__decorate([
|
|
172
|
+
property({ type: Boolean, reflect: true })
|
|
173
|
+
], Divider.prototype, "noMargin", void 0);
|
|
143
174
|
Divider = __decorate([
|
|
144
|
-
customElement(
|
|
175
|
+
customElement(tagName)
|
|
145
176
|
], Divider);
|
|
146
177
|
export { Divider };
|
|
147
|
-
try {
|
|
148
|
-
customElements.define(tagName, Divider);
|
|
149
|
-
}
|
|
150
|
-
catch (e) { }
|