@supersoniks/concorde 1.1.24 → 1.1.26
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/concorde-core.bundle.js +25 -31
- package/concorde-core.es.js +25 -31
- package/core/components/functional/configuration/configuration.js +2 -1
- package/core/components/functional/date/date.js +2 -1
- package/core/components/functional/example/example.js +2 -1
- package/core/components/functional/fetch/fetch.d.ts +0 -31
- package/core/components/functional/fetch/fetch.js +3 -2
- package/core/components/functional/if/if.d.ts +0 -3
- package/core/components/functional/if/if.js +3 -2
- package/core/components/functional/list/list.d.ts +3 -17
- package/core/components/functional/list/list.js +4 -3
- package/core/components/functional/queue/queue.d.ts +1 -8
- package/core/components/functional/queue/queue.js +10 -2
- package/core/components/functional/router/redirect.d.ts +0 -9
- package/core/components/functional/router/redirect.js +3 -2
- package/core/components/functional/router/router.d.ts +0 -14
- package/core/components/functional/router/router.js +3 -2
- package/core/components/functional/sonic-scope/sonic-scope.js +2 -1
- package/core/components/functional/states/states.d.ts +0 -15
- package/core/components/functional/states/states.js +3 -2
- package/core/components/functional/submit/submit.d.ts +0 -11
- package/core/components/functional/submit/submit.js +3 -2
- package/core/components/functional/subscriber/subscriber.d.ts +0 -3
- package/core/components/functional/subscriber/subscriber.js +3 -2
- package/core/components/ui/_css/scroll.d.ts +1 -0
- package/core/components/ui/_css/scroll.js +22 -0
- package/core/components/ui/_css/types.d.ts +2 -0
- package/core/components/ui/_css/types.js +60 -0
- package/core/components/ui/alert/alert.js +12 -12
- package/core/components/ui/badge/badge.js +3 -2
- package/core/components/ui/button/button.d.ts +4 -9
- package/core/components/ui/button/button.js +16 -13
- package/core/components/ui/card/card-footer.d.ts +0 -1
- package/core/components/ui/card/card-footer.js +14 -10
- package/core/components/ui/card/card-header-descripton.js +6 -1
- package/core/components/ui/card/card-header.js +7 -1
- package/core/components/ui/card/card-main.d.ts +0 -1
- package/core/components/ui/card/card-main.js +14 -10
- package/core/components/ui/card/card.js +7 -1
- package/core/components/ui/divider/divider.js +2 -1
- package/core/components/ui/form/checkbox/checkbox.d.ts +1 -20
- package/core/components/ui/form/checkbox/checkbox.js +23 -3
- package/core/components/ui/form/css/form-control.js +36 -33
- package/core/components/ui/form/fieldset/fieldset.d.ts +1 -1
- package/core/components/ui/form/fieldset/fieldset.js +5 -7
- package/core/components/ui/form/fieldset/legend.d.ts +5 -4
- package/core/components/ui/form/fieldset/legend.js +24 -20
- package/core/components/ui/form/form-actions/form-actions.d.ts +5 -0
- package/core/components/ui/form/{form-layout → form-actions}/form-actions.js +13 -5
- package/core/components/ui/form/form-layout/form-layout.js +3 -2
- package/core/components/ui/form/input/input.d.ts +3 -10
- package/core/components/ui/form/input/input.js +3 -2
- package/core/components/ui/form/radio/radio.d.ts +0 -6
- package/core/components/ui/form/radio/radio.js +3 -2
- package/core/components/ui/form/select/select.d.ts +0 -7
- package/core/components/ui/form/select/select.js +6 -4
- package/core/components/ui/form/textarea/textarea.js +10 -2
- package/core/components/ui/group/group.js +3 -2
- package/core/components/ui/icon/icon.d.ts +0 -4
- package/core/components/ui/icon/icon.js +9 -5
- package/core/components/ui/icon/icons.js +43 -17
- package/core/components/ui/icon/icons.json +1 -1
- package/core/components/ui/image/image.js +3 -2
- package/core/components/ui/link/link.js +6 -1
- package/core/components/ui/loader/loader.js +3 -2
- package/core/components/ui/menu/menu-item.js +5 -4
- package/core/components/ui/menu/menu.d.ts +2 -1
- package/core/components/ui/menu/menu.js +18 -13
- package/core/components/ui/modal/modal-actions.js +3 -2
- package/core/components/ui/modal/modal-close.js +4 -3
- package/core/components/ui/modal/modal-content.js +3 -2
- package/core/components/ui/modal/modal-subtitle.js +3 -2
- package/core/components/ui/modal/modal-title.js +3 -2
- package/core/components/ui/modal/modal.js +11 -24
- package/core/components/ui/pop/pop.js +3 -2
- package/core/components/ui/progress/progress.js +29 -7
- package/core/components/ui/table/table-caption.js +11 -2
- package/core/components/ui/table/table-tbody.js +8 -2
- package/core/components/ui/table/table-td.d.ts +4 -2
- package/core/components/ui/table/table-td.js +30 -13
- package/core/components/ui/table/table-tfoot.js +7 -1
- package/core/components/ui/table/table-th.d.ts +4 -1
- package/core/components/ui/table/table-th.js +41 -13
- package/core/components/ui/table/table-thead.js +8 -2
- package/core/components/ui/table/table-tr.js +9 -1
- package/core/components/ui/table/table.d.ts +2 -0
- package/core/components/ui/table/table.js +38 -3
- package/core/components/ui/tabs/tabs.js +3 -4
- package/core/components/ui/taxonomy/taxonomy.js +2 -1
- package/core/components/ui/theme/theme-collection/core-variables.js +12 -8
- package/core/components/ui/theme/theme-collection/dark.js +0 -4
- package/core/components/ui/theme/theme-collection/light.js +0 -1
- package/core/components/ui/theme/theme.d.ts +0 -1
- package/core/components/ui/theme/theme.js +3 -6
- package/core/components/ui/toast/message-subscriber.js +2 -1
- package/core/components/ui/toast/toast-item.d.ts +1 -0
- package/core/components/ui/toast/toast-item.js +51 -31
- package/core/components/ui/toast/toast.js +7 -6
- package/core/components/ui/tooltip/tooltip.js +7 -1
- package/core/components/ui/ui.d.ts +1 -0
- package/core/components/ui/ui.js +1 -0
- package/core/mixins/Fetcher.d.ts +3 -1
- package/core/mixins/Fetcher.js +3 -1
- package/core/mixins/FormElement.js +4 -0
- package/core/utils/api.d.ts +2 -2
- package/core/utils/api.js +7 -7
- package/package.json +7 -3
- package/core/components/ui/form/form-layout/form-actions.d.ts +0 -6
|
@@ -13,6 +13,7 @@ import "@supersoniks/concorde/core/components/ui/icon/icon";
|
|
|
13
13
|
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
14
14
|
import { styleMap } from "lit/directives/style-map.js";
|
|
15
15
|
import "./toast-item";
|
|
16
|
+
const tagName = "sonic-toast";
|
|
16
17
|
let SonicToast = class SonicToast extends LitElement {
|
|
17
18
|
constructor() {
|
|
18
19
|
super(...arguments);
|
|
@@ -22,22 +23,22 @@ let SonicToast = class SonicToast extends LitElement {
|
|
|
22
23
|
return this;
|
|
23
24
|
}
|
|
24
25
|
render() {
|
|
26
|
+
const isIframe = !(window.parent == window);
|
|
25
27
|
let styles = {
|
|
26
28
|
pointerEvents: "none",
|
|
27
|
-
width: "calc(100% - 2.5rem)",
|
|
28
|
-
maxWidth: "64ch",
|
|
29
29
|
gap: "1rem",
|
|
30
30
|
display: "flex",
|
|
31
|
+
margin: "1rem"
|
|
31
32
|
};
|
|
32
|
-
if (
|
|
33
|
-
styles = Object.assign(Object.assign({}, styles), { position: "fixed", bottom: "1.25rem", right: "1.25rem", zIndex: "999", flexDirection: "column-reverse" });
|
|
33
|
+
if (!isIframe) {
|
|
34
|
+
styles = Object.assign(Object.assign({}, styles), { margin: "0", width: "calc(100% - 2.5rem)", position: "fixed", bottom: "1.25rem", right: "1.25rem", zIndex: "999", maxWidth: "64ch", flexDirection: "column-reverse" });
|
|
34
35
|
}
|
|
35
36
|
// ${window.parent == window ? "fixed-area" : ""}
|
|
36
37
|
if (!this.toasts)
|
|
37
38
|
return nothing;
|
|
38
39
|
return html `<div aria-live="polite" style=${styleMap(styles)}>
|
|
39
40
|
${repeat(this.toasts, (item) => item.id, (item) => html `
|
|
40
|
-
<sonic-toast-item status=${item.status} ?ghost=${item.ghost} ?preserve=${item.preserve} id=${item.id}
|
|
41
|
+
<sonic-toast-item maxHeight=${isIframe ? 'none' : '10rem'} status=${item.status} ?ghost=${item.ghost} ?preserve=${item.preserve} id=${item.id}
|
|
41
42
|
@hide=${() => this.removeItem(item)}
|
|
42
43
|
${animate({
|
|
43
44
|
keyframeOptions: {
|
|
@@ -108,7 +109,7 @@ __decorate([
|
|
|
108
109
|
property({ type: Array })
|
|
109
110
|
], SonicToast.prototype, "toasts", void 0);
|
|
110
111
|
SonicToast = __decorate([
|
|
111
|
-
customElement(
|
|
112
|
+
customElement(tagName)
|
|
112
113
|
], SonicToast);
|
|
113
114
|
export { SonicToast };
|
|
114
115
|
if (typeof window !== "undefined") {
|
|
@@ -6,6 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { html, LitElement, css } from "lit";
|
|
8
8
|
import { customElement, property } from "lit/decorators.js";
|
|
9
|
+
const tagName = "sonic-tooltip";
|
|
9
10
|
let Tooltip = class Tooltip extends LitElement {
|
|
10
11
|
constructor() {
|
|
11
12
|
super(...arguments);
|
|
@@ -63,6 +64,11 @@ __decorate([
|
|
|
63
64
|
property({ type: Boolean })
|
|
64
65
|
], Tooltip.prototype, "disabled", void 0);
|
|
65
66
|
Tooltip = __decorate([
|
|
66
|
-
customElement(
|
|
67
|
+
customElement(tagName)
|
|
67
68
|
], Tooltip);
|
|
68
69
|
export { Tooltip };
|
|
70
|
+
//Ajout pour la creation du cem notamment pour Storybook
|
|
71
|
+
try {
|
|
72
|
+
customElements.define(tagName, Tooltip);
|
|
73
|
+
}
|
|
74
|
+
catch (e) { }
|
|
@@ -11,6 +11,7 @@ import "./form/textarea/textarea";
|
|
|
11
11
|
import "./form/fieldset/fieldset";
|
|
12
12
|
import "./form/fieldset/legend";
|
|
13
13
|
import "./form/form-layout/form-layout";
|
|
14
|
+
import "./form/form-actions/form-actions";
|
|
14
15
|
import "./group/group";
|
|
15
16
|
import "./icon/icon";
|
|
16
17
|
import "./image/image";
|
package/core/components/ui/ui.js
CHANGED
package/core/mixins/Fetcher.d.ts
CHANGED
|
@@ -60,7 +60,9 @@ declare const Fetcher: <T extends Constructor<SubscriberInterface>>(superClass:
|
|
|
60
60
|
defferedDebug: boolean | null;
|
|
61
61
|
dispatchEvent(event: Event): void;
|
|
62
62
|
setAttribute(name: string, value: string): void;
|
|
63
|
-
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
63
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void; /**
|
|
64
|
+
* IObserver est l'intersection observer qui permet de charger les données au scroll si l'attribut lazyload est renseigné
|
|
65
|
+
*/
|
|
64
66
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions | undefined): void;
|
|
65
67
|
removeAttribute(name: string): void;
|
|
66
68
|
initPublisher(): void;
|
package/core/mixins/Fetcher.js
CHANGED
|
@@ -17,6 +17,7 @@ import { Loader } from "../components/ui/loader/loader";
|
|
|
17
17
|
import { SonicToast } from "../components/ui/toast/toast";
|
|
18
18
|
import API from "@supersoniks/concorde/core/utils/api";
|
|
19
19
|
import "../components/ui/button/button";
|
|
20
|
+
import { PublisherManager } from "@supersoniks/concorde/utils";
|
|
20
21
|
import Objects from "../utils/Objects";
|
|
21
22
|
import { property } from "lit/decorators.js";
|
|
22
23
|
const Fetcher = (superClass) => {
|
|
@@ -83,7 +84,8 @@ const Fetcher = (superClass) => {
|
|
|
83
84
|
let hasLoader = this.isDefaultLoaderEnabled && !this.hasAttribute("noLoader");
|
|
84
85
|
if (hasLoader)
|
|
85
86
|
Loader.show();
|
|
86
|
-
|
|
87
|
+
let headerData = PublisherManager.getInstance().get(this.getAncestorAttributeValue("headersDataProvider")).get();
|
|
88
|
+
data = yield this.api.get(this.endPoint || this.dataProvider || "", headerData);
|
|
87
89
|
if (!data) {
|
|
88
90
|
SonicToast.add({ text: "Network Error", status: "error" });
|
|
89
91
|
this.isLoading = false;
|
|
@@ -20,6 +20,7 @@ const Form = (superClass) => {
|
|
|
20
20
|
class FormElement extends superClass {
|
|
21
21
|
constructor(...args) {
|
|
22
22
|
super();
|
|
23
|
+
this.touched = false;
|
|
23
24
|
this.error = null;
|
|
24
25
|
this.autofocus = null;
|
|
25
26
|
this.disabled = null;
|
|
@@ -218,6 +219,9 @@ const Form = (superClass) => {
|
|
|
218
219
|
}
|
|
219
220
|
}
|
|
220
221
|
}
|
|
222
|
+
__decorate([
|
|
223
|
+
property({ type: Boolean, reflect: true })
|
|
224
|
+
], FormElement.prototype, "touched", void 0);
|
|
221
225
|
__decorate([
|
|
222
226
|
property({ type: Boolean })
|
|
223
227
|
], FormElement.prototype, "error", void 0);
|
package/core/utils/api.d.ts
CHANGED
|
@@ -39,12 +39,12 @@ declare class API {
|
|
|
39
39
|
* Basic auth
|
|
40
40
|
*/
|
|
41
41
|
auth(): Promise<void>;
|
|
42
|
-
get(path: String): Promise<any>;
|
|
42
|
+
get(path: String, additionalHeaders?: HeadersInit): Promise<any>;
|
|
43
43
|
/**
|
|
44
44
|
* Création du header, avec authentification si besoin
|
|
45
45
|
* ajout du language via le header accept-language qui contient le langue du navigateur
|
|
46
46
|
*/
|
|
47
|
-
createHeaders(): Promise<Record<string, string>>;
|
|
47
|
+
createHeaders(additionalHeaders?: HeadersInit): Promise<Record<string, string>>;
|
|
48
48
|
/**
|
|
49
49
|
* Concatène le serviceURL et le endpoint donné en paramètre
|
|
50
50
|
*/
|
package/core/utils/api.js
CHANGED
|
@@ -43,9 +43,9 @@ class API {
|
|
|
43
43
|
catch (e) { }
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
|
-
get(path) {
|
|
46
|
+
get(path, additionalHeaders) {
|
|
47
47
|
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
-
let headers = yield this.createHeaders();
|
|
48
|
+
let headers = yield this.createHeaders(additionalHeaders);
|
|
49
49
|
const url = this.computeURL(path);
|
|
50
50
|
if (!API.loadingGetPromises.has(url)) {
|
|
51
51
|
let promise = new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -69,7 +69,7 @@ class API {
|
|
|
69
69
|
* Création du header, avec authentification si besoin
|
|
70
70
|
* ajout du language via le header accept-language qui contient le langue du navigateur
|
|
71
71
|
*/
|
|
72
|
-
createHeaders() {
|
|
72
|
+
createHeaders(additionalHeaders) {
|
|
73
73
|
return __awaiter(this, void 0, void 0, function* () {
|
|
74
74
|
yield this.auth();
|
|
75
75
|
let headers = {};
|
|
@@ -77,6 +77,9 @@ class API {
|
|
|
77
77
|
headers.Authorization = "Bearer " + this.token;
|
|
78
78
|
headers.credentials = "include";
|
|
79
79
|
headers["Accept-Language"] = HTML.getLanguage();
|
|
80
|
+
if (additionalHeaders) {
|
|
81
|
+
Object.assign(headers, additionalHeaders);
|
|
82
|
+
}
|
|
80
83
|
return headers;
|
|
81
84
|
});
|
|
82
85
|
}
|
|
@@ -92,12 +95,9 @@ class API {
|
|
|
92
95
|
send(path, data, method = "POST", additionalHeaders) {
|
|
93
96
|
return __awaiter(this, void 0, void 0, function* () {
|
|
94
97
|
yield this.auth();
|
|
95
|
-
let headers = yield this.createHeaders();
|
|
98
|
+
let headers = yield this.createHeaders(additionalHeaders);
|
|
96
99
|
headers["Accept"] = "application/json";
|
|
97
100
|
headers["Content-Type"] = "application/json";
|
|
98
|
-
if (additionalHeaders) {
|
|
99
|
-
Object.assign(headers, additionalHeaders);
|
|
100
|
-
}
|
|
101
101
|
let result = yield fetch(this.computeURL(path), {
|
|
102
102
|
headers: headers,
|
|
103
103
|
method: method,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supersoniks/concorde",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.26",
|
|
4
4
|
"customElements": "custom-elements.json",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -54,6 +54,10 @@
|
|
|
54
54
|
"./functional/submit": "./core/components/functional/submit/submit",
|
|
55
55
|
"./core/components/functional/subscriber/subscriber": "./core/components/functional/subscriber/subscriber",
|
|
56
56
|
"./functional/subscriber": "./core/components/functional/subscriber/subscriber",
|
|
57
|
+
"./core/components/ui/_css/scroll": "./core/components/ui/_css/scroll",
|
|
58
|
+
"./ui/_css/scroll": "./core/components/ui/_css/scroll",
|
|
59
|
+
"./core/components/ui/_css/types": "./core/components/ui/_css/types",
|
|
60
|
+
"./ui/_css/types": "./core/components/ui/_css/types",
|
|
57
61
|
"./core/components/ui/alert/alert": "./core/components/ui/alert/alert",
|
|
58
62
|
"./ui/alert": "./core/components/ui/alert/alert",
|
|
59
63
|
"./core/components/ui/badge/badge": "./core/components/ui/badge/badge",
|
|
@@ -82,8 +86,8 @@
|
|
|
82
86
|
"./ui/form/fieldset/legend-description": "./core/components/ui/form/fieldset/legend-description",
|
|
83
87
|
"./core/components/ui/form/fieldset/legend": "./core/components/ui/form/fieldset/legend",
|
|
84
88
|
"./ui/form/fieldset/legend": "./core/components/ui/form/fieldset/legend",
|
|
85
|
-
"./core/components/ui/form/form-
|
|
86
|
-
"./ui/form/form-
|
|
89
|
+
"./core/components/ui/form/form-actions/form-actions": "./core/components/ui/form/form-actions/form-actions",
|
|
90
|
+
"./ui/form/form-actions": "./core/components/ui/form/form-actions/form-actions",
|
|
87
91
|
"./core/components/ui/form/form-layout/form-layout": "./core/components/ui/form/form-layout/form-layout",
|
|
88
92
|
"./ui/form/form-layout": "./core/components/ui/form/form-layout/form-layout",
|
|
89
93
|
"./core/components/ui/form/input/input": "./core/components/ui/form/input/input",
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { LitElement } from "lit";
|
|
2
|
-
declare const FormActions_base: (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface) & typeof LitElement;
|
|
3
|
-
export declare class FormActions extends FormActions_base {
|
|
4
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
5
|
-
}
|
|
6
|
-
export {};
|