@supersoniks/concorde 1.1.25 → 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/README.md +0 -0
- package/cli.js +0 -0
- package/concorde-core.bundle.js +22 -22
- package/concorde-core.es.js +19 -19
- package/core/components/functional/list/list.d.ts +3 -0
- 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 +1 -1
- package/core/components/ui/button/button.d.ts +1 -1
- package/core/components/ui/button/button.js +0 -4
- package/core/components/ui/card/card-footer.d.ts +0 -1
- package/core/components/ui/card/card-footer.js +7 -9
- package/core/components/ui/card/card-main.d.ts +0 -1
- package/core/components/ui/card/card-main.js +7 -9
- package/core/components/ui/form/checkbox/checkbox.d.ts +1 -0
- package/core/components/ui/form/checkbox/checkbox.js +19 -0
- 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 +0 -4
- package/core/components/ui/form/fieldset/legend.d.ts +3 -3
- package/core/components/ui/form/fieldset/legend.js +3 -8
- package/core/components/ui/form/select/select.js +3 -2
- package/core/components/ui/form/textarea/textarea.js +3 -1
- package/core/components/ui/modal/modal.js +6 -20
- package/core/components/ui/table/table-caption.js +2 -11
- package/core/components/ui/table/table-td.d.ts +1 -0
- package/core/components/ui/table/table-td.js +13 -4
- package/core/components/ui/table/table-th.d.ts +1 -0
- package/core/components/ui/table/table-th.js +23 -9
- package/core/components/ui/table/table-tr.js +2 -0
- package/core/components/ui/table/table.d.ts +2 -0
- package/core/components/ui/table/table.js +26 -4
- package/core/components/ui/tabs/tabs.js +1 -1
- 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.js +4 -1
- package/core/components/ui/toast/toast-item.js +3 -13
- 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 +5 -1
|
@@ -8,31 +8,42 @@ import { html, LitElement, css } from "lit";
|
|
|
8
8
|
import { customElement, property } from "lit/decorators.js";
|
|
9
9
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
10
10
|
import { styleMap } from "lit/directives/style-map.js";
|
|
11
|
+
import { typesColor } from "@supersoniks/concorde/core/components/ui/_css/types";
|
|
11
12
|
const tagName = "sonic-th";
|
|
12
13
|
let TableTh = class TableTh extends LitElement {
|
|
13
14
|
render() {
|
|
14
15
|
const styles = {
|
|
15
16
|
textAlign: this.align,
|
|
17
|
+
minWidth: this.minWidth,
|
|
16
18
|
};
|
|
17
|
-
return html `<th
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
return html `<th
|
|
20
|
+
part="th"
|
|
21
|
+
style=${styleMap(styles)}
|
|
22
|
+
colspan=${ifDefined(this.colSpan)}
|
|
23
|
+
rowspan=${ifDefined(this.rowSpan)}
|
|
24
|
+
>
|
|
25
|
+
<slot></slot>
|
|
26
|
+
</th> `;
|
|
22
27
|
}
|
|
23
28
|
};
|
|
24
29
|
TableTh.styles = [
|
|
30
|
+
typesColor,
|
|
25
31
|
css `
|
|
26
32
|
:host {
|
|
27
33
|
display: contents;
|
|
34
|
+
background:var(--sc-table-bg);
|
|
35
|
+
position:sticky;
|
|
36
|
+
top:0;
|
|
37
|
+
z-index:20;
|
|
28
38
|
}
|
|
29
39
|
|
|
30
40
|
th {
|
|
31
|
-
all:inherit;
|
|
32
|
-
display:table-cell;
|
|
41
|
+
all: inherit;
|
|
42
|
+
display: table-cell;
|
|
43
|
+
border-bottom: calc(var(--sc-border-width) * 1.5) solid var(--sc-table-border-color);
|
|
33
44
|
text-transform: var(--sc-table-th-tt);
|
|
34
|
-
font-weight:var(--sc-table-th-fw);
|
|
35
|
-
font-size:var(--sc-table-th-fs);
|
|
45
|
+
font-weight: var(--sc-table-th-fw);
|
|
46
|
+
font-size: var(--sc-table-th-fs);
|
|
36
47
|
padding: var(--sc-table-th-py) var(--sc-table-th-px);
|
|
37
48
|
}
|
|
38
49
|
`,
|
|
@@ -46,6 +57,9 @@ __decorate([
|
|
|
46
57
|
__decorate([
|
|
47
58
|
property({ type: String })
|
|
48
59
|
], TableTh.prototype, "align", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
property({ type: String })
|
|
62
|
+
], TableTh.prototype, "minWidth", void 0);
|
|
49
63
|
TableTh = __decorate([
|
|
50
64
|
customElement(tagName)
|
|
51
65
|
], TableTh);
|
|
@@ -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 } from "lit/decorators.js";
|
|
9
|
+
import { typesColor } from "@supersoniks/concorde/core/components/ui/_css/types";
|
|
9
10
|
const tagName = "sonic-tr";
|
|
10
11
|
let TableTr = class TableTr extends LitElement {
|
|
11
12
|
render() {
|
|
@@ -13,6 +14,7 @@ let TableTr = class TableTr extends LitElement {
|
|
|
13
14
|
}
|
|
14
15
|
};
|
|
15
16
|
TableTr.styles = [
|
|
17
|
+
typesColor,
|
|
16
18
|
css `
|
|
17
19
|
:host {
|
|
18
20
|
display: table-row;
|
|
@@ -6,6 +6,8 @@ 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
|
+
import { styleMap } from "lit/directives/style-map.js";
|
|
10
|
+
import { customScroll } from "@supersoniks/concorde/core/components/ui/_css/scroll";
|
|
9
11
|
import "./table-tr";
|
|
10
12
|
import "./table-th";
|
|
11
13
|
import "./table-td";
|
|
@@ -20,11 +22,16 @@ let Table = class Table extends LitElement {
|
|
|
20
22
|
this.size = "md";
|
|
21
23
|
this.striped = false;
|
|
22
24
|
this.sticky = false;
|
|
25
|
+
this.bordered = false;
|
|
23
26
|
this.hover = false;
|
|
24
27
|
}
|
|
25
28
|
render() {
|
|
29
|
+
const containerStyles = {
|
|
30
|
+
maxHeight: this.maxHeight,
|
|
31
|
+
};
|
|
26
32
|
return html `
|
|
27
|
-
|
|
33
|
+
|
|
34
|
+
<div class="table-container custom-scroll" style=${styleMap(containerStyles)} >
|
|
28
35
|
<div class="table" ?striped=${this.striped} ?hover=${this.hover} ?sticky=${this.sticky}>
|
|
29
36
|
<slot></slot>
|
|
30
37
|
</div>
|
|
@@ -33,18 +40,23 @@ let Table = class Table extends LitElement {
|
|
|
33
40
|
}
|
|
34
41
|
};
|
|
35
42
|
Table.styles = [
|
|
43
|
+
customScroll,
|
|
36
44
|
css `
|
|
37
45
|
:host {
|
|
38
46
|
--sc-table-fw: var(--sc-font-weight-base);
|
|
39
47
|
--sc-table-fst: var(--sc-font-style-base);
|
|
40
48
|
--sc-table-fs: 1rem;
|
|
49
|
+
--sc-table-border-color: var(--sc-base-200);
|
|
50
|
+
--sc-table-caption-color: var(--sc-base-400);
|
|
51
|
+
--sc-table-bg: var(--sc-base);
|
|
41
52
|
--sc-table-th-fs: .85em;
|
|
42
53
|
--sc-table-th-fw: bold;
|
|
43
54
|
--sc-table-th-tt: uppercase;
|
|
44
55
|
--sc-table-th-px: var(--sc-table-td-px);
|
|
45
|
-
--sc-table-th-py: var(--sc-table-td-py);
|
|
46
|
-
--sc-table-td-px: .
|
|
47
|
-
--sc-table-td-py: .
|
|
56
|
+
--sc-table-th-py: calc(1.8 * var(--sc-table-td-py) );
|
|
57
|
+
--sc-table-td-px: .5em;
|
|
58
|
+
--sc-table-td-py: .5em;
|
|
59
|
+
|
|
48
60
|
display:block;
|
|
49
61
|
}
|
|
50
62
|
|
|
@@ -57,6 +69,7 @@ Table.styles = [
|
|
|
57
69
|
width: 100%;
|
|
58
70
|
font-size: var(--sc-table-fs);
|
|
59
71
|
display: table;
|
|
72
|
+
box-sizing:border-box;
|
|
60
73
|
}
|
|
61
74
|
|
|
62
75
|
/*SIZES*/
|
|
@@ -75,6 +88,9 @@ Table.styles = [
|
|
|
75
88
|
:host([size="xl"]) {
|
|
76
89
|
--sc-table-fs: 1.5rem;
|
|
77
90
|
}
|
|
91
|
+
:host([bordered]) .table-container {
|
|
92
|
+
border:var(--sc-border-width) solid var(--sc-table-border-color) !important;
|
|
93
|
+
}
|
|
78
94
|
|
|
79
95
|
`,
|
|
80
96
|
];
|
|
@@ -87,9 +103,15 @@ __decorate([
|
|
|
87
103
|
__decorate([
|
|
88
104
|
property({ type: Boolean, reflect: true })
|
|
89
105
|
], Table.prototype, "sticky", void 0);
|
|
106
|
+
__decorate([
|
|
107
|
+
property({ type: Boolean, reflect: true })
|
|
108
|
+
], Table.prototype, "bordered", void 0);
|
|
90
109
|
__decorate([
|
|
91
110
|
property({ type: Boolean, reflect: true })
|
|
92
111
|
], Table.prototype, "hover", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
property({ type: String })
|
|
114
|
+
], Table.prototype, "maxHeight", void 0);
|
|
93
115
|
Table = __decorate([
|
|
94
116
|
customElement(tagName)
|
|
95
117
|
], Table);
|
|
File without changes
|
|
File without changes
|
|
@@ -38,7 +38,7 @@ export const coreVariables = css `
|
|
|
38
38
|
--sc-shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
|
|
39
39
|
|
|
40
40
|
/* formulaires*/
|
|
41
|
-
--sc-border-width: max(1px, 0.
|
|
41
|
+
--sc-border-width: max(1px, 0.085rem);
|
|
42
42
|
--sc-form-border-width: var(--sc-border-width);
|
|
43
43
|
--sc-input-bg: var(--sc-base-100);
|
|
44
44
|
--sc-input-border-color: var(--sc-input-bg);
|
|
@@ -47,5 +47,8 @@ export const coreVariables = css `
|
|
|
47
47
|
/*Couleurs -- textes sur images*/
|
|
48
48
|
--sc-contrast-content: #fff;
|
|
49
49
|
--sc-contrast: #0f172a;
|
|
50
|
+
|
|
51
|
+
/*Scrollbar*/
|
|
52
|
+
--sc-scrollbar-bg : var(--sc-base-400);
|
|
50
53
|
}
|
|
51
54
|
`;
|
|
@@ -8,6 +8,7 @@ import { html, LitElement, css, nothing } from "lit";
|
|
|
8
8
|
import { customElement, property, state } from "lit/decorators.js";
|
|
9
9
|
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
10
10
|
import "./types";
|
|
11
|
+
import { customScroll } from "@supersoniks/concorde/core/components/ui/_css/scroll";
|
|
11
12
|
const icon = {
|
|
12
13
|
warning: "warning-circled-outline",
|
|
13
14
|
success: "check-circled-outline",
|
|
@@ -69,6 +70,7 @@ let SonicToastItem = class SonicToastItem extends LitElement {
|
|
|
69
70
|
}
|
|
70
71
|
};
|
|
71
72
|
SonicToastItem.styles = [
|
|
73
|
+
customScroll,
|
|
72
74
|
css `
|
|
73
75
|
* {
|
|
74
76
|
box-sizing: border-box;
|
|
@@ -230,19 +232,7 @@ SonicToastItem.styles = [
|
|
|
230
232
|
pointer-events: none;
|
|
231
233
|
}
|
|
232
234
|
|
|
233
|
-
|
|
234
|
-
.custom-scroll::-webkit-scrollbar {
|
|
235
|
-
width: 0.8rem;
|
|
236
|
-
border: solid 3px transparent;
|
|
237
|
-
border-radius: var(--sc-rounded);
|
|
238
|
-
background:transparent;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
.custom-scroll::-webkit-scrollbar-thumb {
|
|
242
|
-
box-shadow: inset 0 0 2rem 2rem var(--sc-base-500);
|
|
243
|
-
border-radius: var(--sc-rounded);
|
|
244
|
-
border: solid 3px transparent;
|
|
245
|
-
}
|
|
235
|
+
|
|
246
236
|
|
|
247
237
|
`,
|
|
248
238
|
];
|
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",
|