@supersoniks/concorde 1.1.41 → 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/README.md +0 -0
- package/cli.js +0 -0
- package/components.d.ts +0 -0
- package/components.js +2 -3
- package/concorde-core.bundle.js +37 -42
- package/concorde-core.es.js +5702 -4823
- 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 +20 -9
- package/core/components/functional/sdui/sdui.js +64 -24
- package/core/components/functional/sdui/types.d.ts +4 -2
- package/core/components/functional/sdui/types.js +0 -0
- package/core/components/functional/sonic-scope/sonic-scope.d.ts +0 -0
- package/core/components/functional/sonic-scope/sonic-scope.js +0 -0
- 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.d.ts +0 -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/_css/type.d.ts +0 -0
- package/core/components/ui/_css/type.js +0 -0
- 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.d.ts +0 -0
- package/core/components/ui/card/card-footer.js +1 -8
- package/core/components/ui/card/card-header-descripton.d.ts +0 -0
- package/core/components/ui/card/card-header-descripton.js +3 -9
- package/core/components/ui/card/card-header.d.ts +0 -0
- package/core/components/ui/card/card-header.js +1 -6
- package/core/components/ui/card/card-main.d.ts +0 -0
- 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 +44 -17
- package/core/components/ui/form/checkbox/checkbox.d.ts +53 -16
- package/core/components/ui/form/checkbox/checkbox.js +54 -29
- 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.d.ts +0 -0
- package/core/components/ui/form/fieldset/legend-description.js +0 -5
- package/core/components/ui/form/fieldset/legend.d.ts +0 -0
- package/core/components/ui/form/fieldset/legend.js +4 -7
- 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 +89 -54
- package/core/components/ui/form/input/password-helper.d.ts +7 -1
- package/core/components/ui/form/input/password-helper.js +33 -10
- 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 +34 -0
- package/core/components/ui/form/input-autocomplete/input-autocomplete.js +133 -0
- 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 +71 -40
- package/core/components/ui/form/textarea/textarea.d.ts +13 -13
- package/core/components/ui/form/textarea/textarea.js +31 -38
- 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.d.ts +0 -0
- package/core/components/ui/icon/icons.js +11 -8
- package/core/components/ui/icon/icons.json +1 -1
- package/core/components/ui/image/image.d.ts +0 -0
- 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.d.ts +0 -0
- package/core/components/ui/loader/loader.js +2 -8
- package/core/components/ui/loader/styles/fixed.d.ts +0 -0
- package/core/components/ui/loader/styles/fixed.js +0 -0
- package/core/components/ui/loader/styles/inline.d.ts +0 -0
- package/core/components/ui/loader/styles/inline.js +0 -0
- package/core/components/ui/menu/menu-item.d.ts +0 -0
- 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.d.ts +0 -0
- 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.d.ts +0 -0
- package/core/components/ui/modal/modal-content.js +0 -5
- package/core/components/ui/modal/modal-subtitle.d.ts +0 -0
- package/core/components/ui/modal/modal-subtitle.js +2 -6
- package/core/components/ui/modal/modal-title.d.ts +0 -0
- 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 +2 -1
- package/core/components/ui/pop/pop.js +11 -10
- package/core/components/ui/progress/progress.d.ts +0 -0
- package/core/components/ui/progress/progress.js +34 -32
- package/core/components/ui/table/table-caption.d.ts +0 -0
- package/core/components/ui/table/table-caption.js +5 -10
- package/core/components/ui/table/table-tbody.d.ts +0 -0
- 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.d.ts +0 -0
- 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.d.ts +0 -0
- package/core/components/ui/table/table-thead.js +1 -6
- package/core/components/ui/table/table-tr.d.ts +0 -0
- 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/css/tailwind.css +0 -0
- package/core/components/ui/theme/css/tailwind.d.ts +0 -0
- package/core/components/ui/theme/theme-collection/core-variables.d.ts +0 -0
- package/core/components/ui/theme/theme-collection/core-variables.js +13 -11
- package/core/components/ui/theme/theme-collection/dark.d.ts +0 -0
- package/core/components/ui/theme/theme-collection/dark.js +1 -1
- package/core/components/ui/theme/theme-collection/light.d.ts +0 -0
- package/core/components/ui/theme/theme-collection/light.js +0 -0
- 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/message-subscriber.js +0 -0
- package/core/components/ui/toast/toast-item.d.ts +0 -0
- 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/toast/types.d.ts +0 -0
- package/core/components/ui/toast/types.js +0 -0
- package/core/components/ui/tooltip/tooltip.d.ts +1 -0
- package/core/components/ui/tooltip/tooltip.js +35 -14
- package/core/components/ui/ui.d.ts +1 -0
- package/core/components/ui/ui.js +1 -3
- package/core/core.d.ts +0 -0
- 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/mixins/TemplatesContainer.d.ts +0 -0
- package/core/mixins/TemplatesContainer.js +0 -0
- package/core/mixins/mixins.d.ts +0 -0
- package/core/mixins/mixins.js +0 -0
- package/core/utils/Arrays.d.ts +15 -15
- package/core/utils/Arrays.js +0 -0
- 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/Format.d.ts +0 -0
- package/core/utils/Format.js +0 -0
- 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 +47 -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
|
@@ -29,22 +29,23 @@ let SonicToast = class SonicToast extends LitElement {
|
|
|
29
29
|
pointerEvents: "none",
|
|
30
30
|
gap: "1rem",
|
|
31
31
|
display: "flex",
|
|
32
|
-
margin: "1rem"
|
|
32
|
+
margin: "1rem",
|
|
33
33
|
};
|
|
34
34
|
if (!isIframe) {
|
|
35
|
-
styles = Object.assign(Object.assign({}, styles), { margin: "0", width: "calc(100% - 2.5rem)", position: "fixed", bottom: "1.25rem", right: "1.25rem", zIndex: "
|
|
35
|
+
styles = Object.assign(Object.assign({}, styles), { margin: "0", width: "calc(100% - 2.5rem)", position: "fixed", bottom: "1.25rem", right: "1.25rem", zIndex: "10000", maxWidth: "64ch", flexDirection: "column-reverse" });
|
|
36
36
|
}
|
|
37
37
|
// ${window.parent == window ? "fixed-area" : ""}
|
|
38
38
|
if (!this.toasts)
|
|
39
39
|
return nothing;
|
|
40
40
|
return html `<div aria-live="polite" style=${styleMap(styles)}>
|
|
41
41
|
${repeat(this.toasts, (item) => item.id, (item) => html `
|
|
42
|
-
<sonic-toast-item
|
|
42
|
+
<sonic-toast-item
|
|
43
|
+
maxHeight=${isIframe ? "none" : "10rem"}
|
|
43
44
|
status=${ifDefined(item.status)}
|
|
44
45
|
title=${ifDefined(item.title)}
|
|
45
46
|
?ghost=${item.ghost}
|
|
46
47
|
?dismissForever=${item.dismissForever}
|
|
47
|
-
?preserve=${item.preserve}
|
|
48
|
+
?preserve=${item.preserve}
|
|
48
49
|
id=${ifDefined(item.id)}
|
|
49
50
|
@hide=${() => this.removeItem(item)}
|
|
50
51
|
${animate({
|
|
@@ -88,7 +89,7 @@ let SonicToast = class SonicToast extends LitElement {
|
|
|
88
89
|
// Ajoute le toast à la liste
|
|
89
90
|
let toastComponent = document.querySelector("sonic-toast");
|
|
90
91
|
const nextId = (_a = conf.id) !== null && _a !== void 0 ? _a : new Date().valueOf();
|
|
91
|
-
const interactiveRegExp = new RegExp("</a
|
|
92
|
+
const interactiveRegExp = new RegExp("</a>|</.*?button>|</.*?input>|</.*?textarea>|</.*?select>");
|
|
92
93
|
const hasInteractive = interactiveRegExp.test(conf.text);
|
|
93
94
|
const currentToast = {
|
|
94
95
|
id: nextId,
|
|
@@ -101,7 +102,7 @@ let SonicToast = class SonicToast extends LitElement {
|
|
|
101
102
|
};
|
|
102
103
|
// check if the toast is dismissed
|
|
103
104
|
if (conf.dismissForever && conf.id) {
|
|
104
|
-
const dismissed = localStorage.getItem(
|
|
105
|
+
const dismissed = localStorage.getItem("sonic-toast-dismissed") || "{}";
|
|
105
106
|
const dismissedObj = JSON.parse(dismissed);
|
|
106
107
|
if (dismissedObj[conf.id]) {
|
|
107
108
|
return null;
|
|
@@ -109,18 +110,33 @@ let SonicToast = class SonicToast extends LitElement {
|
|
|
109
110
|
}
|
|
110
111
|
if (toastComponent.toasts.length > 0) {
|
|
111
112
|
let toastA = Object.assign({}, currentToast);
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
113
|
+
for (const toast of toastComponent.toasts) {
|
|
114
|
+
let toastB = Object.assign({}, toast);
|
|
115
|
+
toastA.id = toastB.id = 0;
|
|
116
|
+
if ( /*!currentToast.preserve && */Objects.shallowEqual(toastA, toastB)) {
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
116
119
|
}
|
|
117
120
|
}
|
|
118
121
|
toastComponent.toasts = [...toastComponent.toasts, currentToast];
|
|
119
122
|
return currentToast;
|
|
120
123
|
}
|
|
124
|
+
static removeItem(toastToRemove) {
|
|
125
|
+
let toastComponent = document.querySelector("sonic-toast");
|
|
126
|
+
if (!toastComponent)
|
|
127
|
+
return;
|
|
128
|
+
console.log(toastToRemove);
|
|
129
|
+
toastComponent.removeItem(toastToRemove);
|
|
130
|
+
}
|
|
121
131
|
// Remove Toast
|
|
122
|
-
removeItem(
|
|
123
|
-
|
|
132
|
+
removeItem(toastToRemove) {
|
|
133
|
+
if (!toastToRemove)
|
|
134
|
+
return;
|
|
135
|
+
this.toasts = this.toasts.filter((toast) => {
|
|
136
|
+
toast = Object.assign({}, toast);
|
|
137
|
+
delete toast.id;
|
|
138
|
+
return !Objects.shallowEqual(toast, toastToRemove, false);
|
|
139
|
+
});
|
|
124
140
|
}
|
|
125
141
|
};
|
|
126
142
|
__decorate([
|
|
@@ -131,6 +147,5 @@ SonicToast = __decorate([
|
|
|
131
147
|
], SonicToast);
|
|
132
148
|
export { SonicToast };
|
|
133
149
|
if (typeof window !== "undefined") {
|
|
134
|
-
|
|
135
|
-
win.SonicToast = SonicToast;
|
|
150
|
+
window.SonicToast = SonicToast;
|
|
136
151
|
}
|
|
File without changes
|
|
File without changes
|
|
@@ -15,22 +15,21 @@ let Tooltip = class Tooltip extends LitElement {
|
|
|
15
15
|
}
|
|
16
16
|
render() {
|
|
17
17
|
let disabledClass = this.disabled || this.label == "" ? "disabled" : "";
|
|
18
|
-
return html `<div
|
|
19
|
-
data-tooltip-text="${this.label.trim().replace(" ", " ")}"
|
|
20
|
-
class="tooltip ${disabledClass}"
|
|
21
|
-
>
|
|
18
|
+
return html `<div data-tooltip-text="${this.label.trim().replace(" ", " ")}" class="tooltip ${disabledClass}">
|
|
22
19
|
<slot></slot>
|
|
23
20
|
</div>`;
|
|
24
21
|
}
|
|
25
22
|
};
|
|
26
23
|
Tooltip.styles = [
|
|
27
24
|
css `
|
|
28
|
-
|
|
25
|
+
:host {
|
|
29
26
|
position: relative;
|
|
30
|
-
display: flex;
|
|
27
|
+
display: inline-flex;
|
|
31
28
|
align-items: center;
|
|
32
29
|
text-align: center;
|
|
30
|
+
--sc-tooltip-fw: var(--sc-font-weight-base);
|
|
33
31
|
}
|
|
32
|
+
|
|
34
33
|
.tooltip:before {
|
|
35
34
|
position: absolute;
|
|
36
35
|
content: attr(data-tooltip-text);
|
|
@@ -38,9 +37,6 @@ Tooltip.styles = [
|
|
|
38
37
|
display: block;
|
|
39
38
|
opacity: 0;
|
|
40
39
|
pointer-events: none;
|
|
41
|
-
bottom: calc(100% + 0.25rem);
|
|
42
|
-
left: 50%;
|
|
43
|
-
transform: translateX(-50%);
|
|
44
40
|
background: var(--sc-base-content, #111827);
|
|
45
41
|
padding: 0.25rem;
|
|
46
42
|
border-radius: 0.25rem;
|
|
@@ -50,16 +46,46 @@ Tooltip.styles = [
|
|
|
50
46
|
line-height: 1.1;
|
|
51
47
|
width: max-content;
|
|
52
48
|
max-width: 20rem;
|
|
49
|
+
white-space: pre-line;
|
|
50
|
+
font-weight: var(--sc-tooltip-fw);
|
|
53
51
|
}
|
|
54
52
|
.tooltip:not(.disabled):hover:before {
|
|
55
53
|
opacity: 1;
|
|
56
54
|
display: block;
|
|
57
55
|
}
|
|
56
|
+
|
|
57
|
+
:host(:not([placement])) .tooltip:before,
|
|
58
|
+
:host([placement="top"]) .tooltip:before {
|
|
59
|
+
bottom: calc(100% + 0.25rem);
|
|
60
|
+
left: 50%;
|
|
61
|
+
transform: translateX(-50%);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
:host([placement="bottom"]) .tooltip:before {
|
|
65
|
+
top: calc(100% + 0.25rem);
|
|
66
|
+
left: 50%;
|
|
67
|
+
transform: translateX(-50%);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
:host([placement="left"]) .tooltip:before {
|
|
71
|
+
top: 50%;
|
|
72
|
+
right: calc(100% + 0.25rem);
|
|
73
|
+
transform: translateY(-50%);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
:host([placement="right"]) .tooltip:before {
|
|
77
|
+
top: 50%;
|
|
78
|
+
transform: translateY(-50%);
|
|
79
|
+
left: calc(100% + 0.25rem);
|
|
80
|
+
}
|
|
58
81
|
`,
|
|
59
82
|
];
|
|
60
83
|
__decorate([
|
|
61
84
|
property({ type: String })
|
|
62
85
|
], Tooltip.prototype, "label", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
property({ type: String, reflect: true })
|
|
88
|
+
], Tooltip.prototype, "placement", void 0);
|
|
63
89
|
__decorate([
|
|
64
90
|
property({ type: Boolean })
|
|
65
91
|
], Tooltip.prototype, "disabled", void 0);
|
|
@@ -67,8 +93,3 @@ Tooltip = __decorate([
|
|
|
67
93
|
customElement(tagName)
|
|
68
94
|
], Tooltip);
|
|
69
95
|
export { Tooltip };
|
|
70
|
-
//Ajout pour la creation du cem notamment pour Storybook
|
|
71
|
-
try {
|
|
72
|
-
customElements.define(tagName, Tooltip);
|
|
73
|
-
}
|
|
74
|
-
catch (e) { }
|
|
@@ -4,6 +4,7 @@ import "./button/button";
|
|
|
4
4
|
import "./link/link";
|
|
5
5
|
import "./progress/progress";
|
|
6
6
|
import "./form/input/input";
|
|
7
|
+
import "./form/input-autocomplete/input-autocomplete";
|
|
7
8
|
import "./form/input/password-helper";
|
|
8
9
|
import "./form/input/same-value-helper";
|
|
9
10
|
import "./form/checkbox/checkbox";
|
package/core/components/ui/ui.js
CHANGED
|
@@ -7,6 +7,7 @@ import "./link/link";
|
|
|
7
7
|
import "./progress/progress";
|
|
8
8
|
// FORMS
|
|
9
9
|
import "./form/input/input";
|
|
10
|
+
import "./form/input-autocomplete/input-autocomplete";
|
|
10
11
|
import "./form/input/password-helper";
|
|
11
12
|
import "./form/input/same-value-helper";
|
|
12
13
|
import "./form/checkbox/checkbox";
|
|
@@ -25,9 +26,6 @@ import "./loader/loader";
|
|
|
25
26
|
import "./taxonomy/taxonomy";
|
|
26
27
|
//Menu
|
|
27
28
|
import "./menu/menu";
|
|
28
|
-
//Tabs
|
|
29
|
-
// import "./tabs/tabs";
|
|
30
|
-
// import "./tabs/tab";
|
|
31
29
|
// Misc
|
|
32
30
|
import "./modal/modal";
|
|
33
31
|
import "./alert/alert";
|
package/core/core.d.ts
CHANGED
|
File without changes
|
package/core/core.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import "./components/functional/functional";
|
|
2
2
|
import "./components/ui/ui";
|
|
3
3
|
import "./mixins/mixins";
|
|
4
|
-
import { PublisherManager } from "@supersoniks/concorde/core/utils/PublisherProxy
|
|
4
|
+
import { PublisherManager } from "@supersoniks/concorde/core/utils/PublisherProxy";
|
|
5
5
|
import DataBindObserver from "./utils/DataBindObserver";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
win.SonicDataBindObserver = DataBindObserver;
|
|
6
|
+
if (!window.SonicPublisherManager)
|
|
7
|
+
window.SonicPublisherManager = PublisherManager;
|
|
8
|
+
if (!window.SonicDataBindObserver)
|
|
9
|
+
window.SonicDataBindObserver = DataBindObserver;
|
package/core/mixins/Fetcher.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="node" />
|
|
2
2
|
import "@supersoniks/concorde/core/components/ui/button/button";
|
|
3
3
|
import { SubscriberInterface } from "@supersoniks/concorde/core/mixins/Subscriber";
|
|
4
|
+
import API from "@supersoniks/concorde/core/utils/api";
|
|
4
5
|
declare type Constructor<T> = new (...args: any[]) => T;
|
|
5
|
-
declare const Fetcher: <T extends Constructor<SubscriberInterface>>(superClass: T) => {
|
|
6
|
+
declare const Fetcher: <PropsType = any, T extends Constructor<SubscriberInterface<PropsType>> = any>(superClass: T, propsType?: PropsType | undefined) => {
|
|
6
7
|
new (...args: any[]): {
|
|
7
8
|
api: API | null;
|
|
8
9
|
/**
|
|
@@ -33,6 +34,9 @@ declare const Fetcher: <T extends Constructor<SubscriberInterface>>(superClass:
|
|
|
33
34
|
isFetchEnabled: boolean;
|
|
34
35
|
_endPoint: string;
|
|
35
36
|
endPoint: string;
|
|
37
|
+
requestId: number;
|
|
38
|
+
refetchEveryMs: number;
|
|
39
|
+
refetchTimeOutId?: NodeJS.Timeout | undefined;
|
|
36
40
|
/**
|
|
37
41
|
*
|
|
38
42
|
* C'est ici que les données sont chargées via l'utilitaire API
|
|
@@ -40,7 +44,7 @@ declare const Fetcher: <T extends Constructor<SubscriberInterface>>(superClass:
|
|
|
40
44
|
* Un Toast est affiché si le chargement échoue
|
|
41
45
|
*/
|
|
42
46
|
_fetchData(): Promise<void>;
|
|
43
|
-
onInvalidate
|
|
47
|
+
onInvalidate?: (() => void) | undefined;
|
|
44
48
|
disconnectedCallback(): void;
|
|
45
49
|
connectedCallback(): void;
|
|
46
50
|
/**
|
|
@@ -48,27 +52,32 @@ declare const Fetcher: <T extends Constructor<SubscriberInterface>>(superClass:
|
|
|
48
52
|
*/
|
|
49
53
|
firstUpdated(): void;
|
|
50
54
|
onIntersection(entries: IntersectionObserverEntry[]): void;
|
|
51
|
-
props:
|
|
55
|
+
props: PropsType | null;
|
|
52
56
|
propertyMap: Object;
|
|
53
57
|
isConnected: boolean;
|
|
54
|
-
getAncestorAttributeValue(attributeName: string): string;
|
|
55
|
-
* Après le chargement des données on traverse l'objet reçu en fonctione de la cible exprimées dans cette propriété avec la dot syntaxe.
|
|
56
|
-
* C'est cette donnée cible qui est injectée dans les pros et donc disponible via le publisher disponible globalement via PublisherManager.get(dataProvider)
|
|
57
|
-
*/
|
|
58
|
+
getAncestorAttributeValue(attributeName: string): string;
|
|
58
59
|
hasAncestorAttribute(attributeName: string): boolean;
|
|
59
60
|
querySelectorAll(selector: string): NodeListOf<Element>;
|
|
60
61
|
publisher: any;
|
|
61
62
|
dataProvider: string | null;
|
|
62
|
-
noShadowDom: string | null;
|
|
63
|
+
noShadowDom: string | null; /**
|
|
64
|
+
* isFirstLoad vaut true jusqu'au premier chargement de données
|
|
65
|
+
*/
|
|
63
66
|
debug: HTMLElement | null;
|
|
64
67
|
defferedDebug: boolean | null;
|
|
65
68
|
displayContents: boolean;
|
|
69
|
+
shadowRoot?: ShadowRoot | undefined; /**
|
|
70
|
+
* isLoading vaut true pendant le chargement des données
|
|
71
|
+
*/
|
|
66
72
|
dispatchEvent(event: Event): void;
|
|
67
73
|
setAttribute(name: string, value: string): void;
|
|
68
74
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
69
75
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions | undefined): void;
|
|
70
76
|
removeAttribute(name: string): void;
|
|
71
|
-
initPublisher(): void;
|
|
77
|
+
initPublisher(): void; /**
|
|
78
|
+
* On peut désactiver le fetch programmatiquement via cette propriété.
|
|
79
|
+
* Cela est le cas pour le composant sonic-list qui ne fetch que si l'attribut fetch est renseigné
|
|
80
|
+
*/
|
|
72
81
|
getApiConfiguration(): import("@supersoniks/concorde/core/utils/api").APIConfiguration;
|
|
73
82
|
requestUpdate(): void;
|
|
74
83
|
getAttribute(name: string): string;
|
package/core/mixins/Fetcher.js
CHANGED
|
@@ -13,14 +13,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
13
13
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
|
+
import "@supersoniks/concorde/core/components/ui/button/button";
|
|
16
17
|
import { Loader } from "@supersoniks/concorde/core/components/ui/loader/loader";
|
|
17
18
|
import { SonicToast } from "@supersoniks/concorde/core/components/ui/toast/toast";
|
|
18
19
|
import API from "@supersoniks/concorde/core/utils/api";
|
|
19
|
-
import "@supersoniks/concorde/core/components/ui/button/button";
|
|
20
|
-
import { PublisherManager } from "@supersoniks/concorde/utils";
|
|
21
20
|
import Objects from "@supersoniks/concorde/core/utils/Objects";
|
|
21
|
+
import { PublisherManager } from "@supersoniks/concorde/utils";
|
|
22
22
|
import { property } from "lit/decorators.js";
|
|
23
|
-
const Fetcher = (superClass) => {
|
|
23
|
+
const Fetcher = (superClass, propsType) => {
|
|
24
|
+
propsType;
|
|
24
25
|
class FetcherElement extends superClass {
|
|
25
26
|
constructor(...args) {
|
|
26
27
|
super();
|
|
@@ -52,6 +53,8 @@ const Fetcher = (superClass) => {
|
|
|
52
53
|
*/
|
|
53
54
|
this.isFetchEnabled = true;
|
|
54
55
|
this._endPoint = "";
|
|
56
|
+
this.requestId = 0;
|
|
57
|
+
this.refetchEveryMs = 0;
|
|
55
58
|
args;
|
|
56
59
|
this.dataProvider = "";
|
|
57
60
|
}
|
|
@@ -102,37 +105,44 @@ const Fetcher = (superClass) => {
|
|
|
102
105
|
Loader.hide();
|
|
103
106
|
if (this.key) {
|
|
104
107
|
let response = data._sonic_http_response_;
|
|
105
|
-
|
|
106
|
-
|
|
108
|
+
/* preserveOtherKeys s'exprime lorsque le paramètre "key" est défini
|
|
109
|
+
* Conserve les autres propriétés de l'objet reçu, en plus des propriétés définies sous "key"
|
|
110
|
+
*/
|
|
111
|
+
data = Objects.traverse(data, this.key.split("."), this.hasAttribute("preserveOtherKeys"));
|
|
112
|
+
if (data && Objects.isObject(data) && response)
|
|
107
113
|
data._sonic_http_response_ = response;
|
|
108
114
|
}
|
|
109
115
|
this.props = data;
|
|
110
116
|
this.dispatchEvent(new CustomEvent("load", { detail: this }));
|
|
111
117
|
this.isFirstLoad = false;
|
|
112
118
|
this.isLoading = false;
|
|
119
|
+
if (this.refetchEveryMs && this.isConnected) {
|
|
120
|
+
this.refetchTimeOutId = setTimeout(() => this._fetchData(), this.refetchEveryMs);
|
|
121
|
+
}
|
|
113
122
|
});
|
|
114
123
|
}
|
|
115
124
|
disconnectedCallback() {
|
|
116
125
|
var _a;
|
|
117
126
|
super.disconnectedCallback();
|
|
118
127
|
(_a = this.publisher) === null || _a === void 0 ? void 0 : _a.offInvalidate(this.onInvalidate);
|
|
128
|
+
clearTimeout(this.refetchTimeOutId);
|
|
119
129
|
this.isFirstLoad = false;
|
|
120
130
|
}
|
|
121
131
|
connectedCallback() {
|
|
122
132
|
var _a;
|
|
123
|
-
this.noShadowDom = "";
|
|
133
|
+
// this.noShadowDom = "";
|
|
124
134
|
if (!this.isFetchEnabled) {
|
|
125
135
|
super.connectedCallback();
|
|
126
136
|
return;
|
|
127
137
|
}
|
|
128
138
|
super.connectedCallback();
|
|
129
|
-
this.key = this.
|
|
139
|
+
this.key = this.getAttribute("key");
|
|
130
140
|
if (this.props) {
|
|
131
141
|
this.publisher.set(this.props);
|
|
132
142
|
}
|
|
133
143
|
this.onInvalidate = () => this._fetchData();
|
|
134
144
|
(_a = this.publisher) === null || _a === void 0 ? void 0 : _a.onInvalidate(this.onInvalidate);
|
|
135
|
-
const lazyLoad = this.
|
|
145
|
+
const lazyLoad = this.getAttribute("lazyload");
|
|
136
146
|
if (lazyLoad === null) {
|
|
137
147
|
this._fetchData();
|
|
138
148
|
}
|
|
@@ -141,7 +151,7 @@ const Fetcher = (superClass) => {
|
|
|
141
151
|
* Première update, le comportement de lazyload est géré ici a l'aide d'un intersection observer.
|
|
142
152
|
*/
|
|
143
153
|
firstUpdated() {
|
|
144
|
-
const lazyLoad = this.
|
|
154
|
+
const lazyLoad = this.getAttribute("lazyload");
|
|
145
155
|
if (lazyLoad === null) {
|
|
146
156
|
return;
|
|
147
157
|
}
|
|
@@ -151,7 +161,7 @@ const Fetcher = (superClass) => {
|
|
|
151
161
|
};
|
|
152
162
|
this.iObserver = new IntersectionObserver((entries) => this.onIntersection(entries), options);
|
|
153
163
|
let that = this;
|
|
154
|
-
let elt =
|
|
164
|
+
let elt = this.shadowRoot ? this.shadowRoot.children[0] : that.children[0];
|
|
155
165
|
if (elt && elt.nodeName.toLocaleLowerCase() == "slot")
|
|
156
166
|
elt = elt.children[0];
|
|
157
167
|
if (!elt || elt.nodeName.toLocaleLowerCase() == "template") {
|
|
@@ -176,6 +186,12 @@ const Fetcher = (superClass) => {
|
|
|
176
186
|
__decorate([
|
|
177
187
|
property({ type: String })
|
|
178
188
|
], FetcherElement.prototype, "endPoint", null);
|
|
189
|
+
__decorate([
|
|
190
|
+
property()
|
|
191
|
+
], FetcherElement.prototype, "requestId", void 0);
|
|
192
|
+
__decorate([
|
|
193
|
+
property({ type: Number })
|
|
194
|
+
], FetcherElement.prototype, "refetchEveryMs", void 0);
|
|
179
195
|
return FetcherElement; // as Constructor<SubscriberInterface> & T;
|
|
180
196
|
};
|
|
181
197
|
export default Fetcher;
|
|
@@ -16,13 +16,15 @@ declare const Form: <T extends Constructor<FormElementInterface>>(superClass: T)
|
|
|
16
16
|
Active le mode radio
|
|
17
17
|
*/
|
|
18
18
|
radio: true | null;
|
|
19
|
+
unCheckOnDisconnect: boolean;
|
|
19
20
|
/**
|
|
20
21
|
* propriété checked avec des caractéristiques similaire à un input html classique.
|
|
21
22
|
*/
|
|
22
|
-
_checked: true | null;
|
|
23
|
-
checked: true | null;
|
|
23
|
+
_checked: true | null | "indeterminate";
|
|
24
|
+
checked: true | "indeterminate" | null;
|
|
24
25
|
validateFormElement(): void;
|
|
25
|
-
|
|
26
|
+
checksAll(): boolean;
|
|
27
|
+
setCheckedValue(checked: true | null | "indeterminate"): void;
|
|
26
28
|
handleChange(): void;
|
|
27
29
|
/**
|
|
28
30
|
* Voir la mixin FormElement
|
|
@@ -34,16 +36,24 @@ declare const Form: <T extends Constructor<FormElementInterface>>(superClass: T)
|
|
|
34
36
|
* Le comportement est modifié de la manière suivante :
|
|
35
37
|
* L'état du composant (checked) est mis à jour en fonction de la valeur fournie par le publisher associé au composant / en fonction de sont mode (radio, unique)
|
|
36
38
|
*/
|
|
37
|
-
setFormValueFromPublisher(value:
|
|
38
|
-
|
|
39
|
+
setFormValueFromPublisher(value: string | Array<string | null> | null): void;
|
|
40
|
+
getCheckAllPublisher(): any;
|
|
41
|
+
updateAllChecked: () => void;
|
|
42
|
+
onChecksAllRequest: (value: string) => void;
|
|
43
|
+
disconnectedCallback(): void;
|
|
44
|
+
connectedCallback(): void;
|
|
39
45
|
getFormPublisher(): any;
|
|
40
46
|
updateDataValue(): void;
|
|
41
|
-
handleBlur(e?:
|
|
47
|
+
handleBlur(e?: Event | undefined): void;
|
|
48
|
+
focus?: (() => void) | undefined;
|
|
49
|
+
shadowRoot?: ShadowRoot | undefined;
|
|
42
50
|
error: boolean;
|
|
43
51
|
autofocus: boolean;
|
|
44
52
|
required: boolean;
|
|
45
53
|
disabled: true | null;
|
|
46
54
|
formDataProvider: string;
|
|
55
|
+
ariaLabelledby?: string | undefined;
|
|
56
|
+
ariaLabel?: string | undefined;
|
|
47
57
|
_name: string;
|
|
48
58
|
name: string;
|
|
49
59
|
props: any;
|
|
@@ -63,12 +73,11 @@ declare const Form: <T extends Constructor<FormElementInterface>>(superClass: T)
|
|
|
63
73
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
64
74
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions | undefined): void;
|
|
65
75
|
removeAttribute(name: string): void;
|
|
76
|
+
initPublisher(): void;
|
|
66
77
|
getApiConfiguration(): import("../utils/api").APIConfiguration;
|
|
67
|
-
connectedCallback(): void;
|
|
68
78
|
requestUpdate(): void;
|
|
69
79
|
getAttribute(name: string): string;
|
|
70
80
|
hasAttribute(attributeName: String): boolean;
|
|
71
|
-
disconnectedCallback(): void;
|
|
72
81
|
};
|
|
73
82
|
} & T;
|
|
74
83
|
export default Form;
|