@supersoniks/concorde 1.1.28 → 1.1.30
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 +21 -22
- package/concorde-core.es.js +22 -23
- package/core/components/functional/subscriber/subscriber.d.ts +2 -1
- package/core/components/functional/subscriber/subscriber.js +8 -0
- package/core/components/ui/_css/size.d.ts +1 -0
- package/core/components/ui/_css/size.js +26 -0
- package/core/components/ui/_css/type.d.ts +2 -0
- package/core/components/ui/_css/{types.js → type.js} +1 -1
- package/core/components/ui/alert/alert.d.ts +1 -1
- package/core/components/ui/alert/alert.js +6 -15
- package/core/components/ui/badge/badge.d.ts +1 -1
- package/core/components/ui/badge/badge.js +7 -6
- package/core/components/ui/button/button.d.ts +11 -6
- package/core/components/ui/button/button.js +32 -35
- package/core/components/ui/card/card-header.js +1 -1
- package/core/components/ui/divider/divider.d.ts +1 -1
- package/core/components/ui/divider/divider.js +7 -3
- package/core/components/ui/form/checkbox/checkbox.d.ts +11 -9
- package/core/components/ui/form/checkbox/checkbox.js +10 -6
- package/core/components/ui/form/css/form-control.js +56 -31
- package/core/components/ui/form/input/input.d.ts +23 -19
- package/core/components/ui/form/input/input.js +35 -33
- package/core/components/ui/form/radio/radio.js +1 -2
- package/core/components/ui/form/select/select.d.ts +9 -9
- package/core/components/ui/form/select/select.js +8 -14
- package/core/components/ui/form/textarea/textarea.d.ts +18 -17
- package/core/components/ui/form/textarea/textarea.js +12 -23
- package/core/components/ui/icon/icon.js +4 -0
- package/core/components/ui/image/image.d.ts +0 -1
- package/core/components/ui/image/image.js +0 -23
- package/core/components/ui/pop/pop.d.ts +1 -0
- package/core/components/ui/pop/pop.js +8 -0
- package/core/components/ui/progress/progress.d.ts +1 -0
- package/core/components/ui/progress/progress.js +13 -20
- package/core/components/ui/table/table-td.d.ts +1 -0
- package/core/components/ui/table/table-td.js +6 -2
- package/core/components/ui/table/table-th.js +2 -2
- package/core/components/ui/table/table-tr.js +3 -2
- package/core/components/ui/table/table.d.ts +1 -1
- package/core/components/ui/table/table.js +3 -20
- 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 +19 -8
- package/core/components/ui/theme/theme.d.ts +8 -1
- package/core/components/ui/theme/theme.js +42 -1
- package/core/components/ui/toast/toast-item.js +1 -1
- package/core/mixins/FormCheckable.d.ts +3 -2
- package/core/mixins/FormCheckable.js +5 -2
- package/core/mixins/FormElement.d.ts +3 -2
- package/core/mixins/FormElement.js +8 -4
- package/core/mixins/FormInput.d.ts +6 -5
- package/core/mixins/FormInput.js +1 -3
- package/mixins.d.ts +8 -6
- package/package.json +5 -3
- package/core/components/ui/_css/types.d.ts +0 -2
|
@@ -14,6 +14,7 @@ let Pop = Pop_1 = class Pop extends LitElement {
|
|
|
14
14
|
super(...arguments);
|
|
15
15
|
this.open = false;
|
|
16
16
|
this.toggle = "true";
|
|
17
|
+
this.inline = false;
|
|
17
18
|
/**
|
|
18
19
|
* Ombre
|
|
19
20
|
*/
|
|
@@ -196,6 +197,10 @@ Pop.styles = [
|
|
|
196
197
|
:host([shadow="lg"]) slot[name="content"] {
|
|
197
198
|
box-shadow: var(--sc-shadow-lg);
|
|
198
199
|
}
|
|
200
|
+
|
|
201
|
+
:host([inline]) {
|
|
202
|
+
vertical-align: baseline;
|
|
203
|
+
}
|
|
199
204
|
`,
|
|
200
205
|
];
|
|
201
206
|
__decorate([
|
|
@@ -210,6 +215,9 @@ __decorate([
|
|
|
210
215
|
__decorate([
|
|
211
216
|
property({ type: String })
|
|
212
217
|
], Pop.prototype, "toggle", void 0);
|
|
218
|
+
__decorate([
|
|
219
|
+
property({ type: Boolean, reflect: true })
|
|
220
|
+
], Pop.prototype, "inline", void 0);
|
|
213
221
|
__decorate([
|
|
214
222
|
property({ type: String, reflect: true })
|
|
215
223
|
], Pop.prototype, "shadow", void 0);
|
|
@@ -3,6 +3,7 @@ export declare class Progress extends LitElement {
|
|
|
3
3
|
static styles: import("lit").CSSResult[];
|
|
4
4
|
value?: number;
|
|
5
5
|
max: number;
|
|
6
|
+
invert: boolean;
|
|
6
7
|
type: "default" | "primary" | "warning" | "danger" | "success" | "info";
|
|
7
8
|
size: "xs" | "sm" | "md" | "lg" | "xl";
|
|
8
9
|
render(): import("lit-html").TemplateResult<1>;
|
|
@@ -7,11 +7,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
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
|
+
import { fontSize } from "@supersoniks/concorde/core/components/ui/_css/size";
|
|
10
11
|
const tagName = "sonic-progress";
|
|
11
12
|
let Progress = class Progress extends LitElement {
|
|
12
13
|
constructor() {
|
|
13
14
|
super(...arguments);
|
|
14
15
|
this.max = 100;
|
|
16
|
+
this.invert = false;
|
|
15
17
|
this.type = "default";
|
|
16
18
|
this.size = "md";
|
|
17
19
|
}
|
|
@@ -26,12 +28,13 @@ let Progress = class Progress extends LitElement {
|
|
|
26
28
|
}
|
|
27
29
|
};
|
|
28
30
|
Progress.styles = [
|
|
31
|
+
fontSize,
|
|
29
32
|
css `
|
|
30
33
|
:host {
|
|
31
34
|
--sc-progress-bg: var(--sc-input-bg, var(--sc-base-100, #f5f5f5));
|
|
32
35
|
--sc-progress-color: var(--sc-base-content, #1f2937);
|
|
33
|
-
--sc-progress-height: .
|
|
34
|
-
--sc-progress-fs: 1rem;
|
|
36
|
+
--sc-progress-height: .6em;
|
|
37
|
+
--sc-progress-fs: var(--sc-fs, 1rem);
|
|
35
38
|
--sc-progress-fw: 500;
|
|
36
39
|
--sc-progress-rounded: var(--sc-rounded-lg);
|
|
37
40
|
display: block;
|
|
@@ -103,25 +106,11 @@ Progress.styles = [
|
|
|
103
106
|
--sc-progress-color: var(--sc-success);
|
|
104
107
|
}
|
|
105
108
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
--sc-progress-height:.25rem;
|
|
109
|
-
--sc-progress-fs: 0.68rem;
|
|
109
|
+
:host([invert]) {
|
|
110
|
+
--sc-progress-bg: var(--sc-base-700);
|
|
110
111
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
--sc-progress-height:.4rem;
|
|
114
|
-
--sc-progress-fs: 0.85rem;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
:host([size="lg"]) {
|
|
118
|
-
--sc-progress-height:1rem;
|
|
119
|
-
--sc-progress-fs: 1.25rem;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
:host([size="xl"]) {
|
|
123
|
-
--sc-progress-height:1.5rem;
|
|
124
|
-
--sc-progress-fs: 1.5rem;
|
|
112
|
+
:host([type="default"][invert]) {
|
|
113
|
+
--sc-progress-color: var(--sc-base);
|
|
125
114
|
}
|
|
126
115
|
|
|
127
116
|
slot[name="remaining"] {
|
|
@@ -135,6 +124,7 @@ Progress.styles = [
|
|
|
135
124
|
display:flex;
|
|
136
125
|
justify-content: space-between;
|
|
137
126
|
gap:.5em;
|
|
127
|
+
margin-top:.15em;
|
|
138
128
|
}
|
|
139
129
|
`
|
|
140
130
|
];
|
|
@@ -144,6 +134,9 @@ __decorate([
|
|
|
144
134
|
__decorate([
|
|
145
135
|
property({ type: Number })
|
|
146
136
|
], Progress.prototype, "max", void 0);
|
|
137
|
+
__decorate([
|
|
138
|
+
property({ type: Boolean })
|
|
139
|
+
], Progress.prototype, "invert", void 0);
|
|
147
140
|
__decorate([
|
|
148
141
|
property({ type: String, reflect: true })
|
|
149
142
|
], Progress.prototype, "type", void 0);
|
|
@@ -9,11 +9,12 @@ 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
11
|
const tagName = "sonic-td";
|
|
12
|
-
import {
|
|
12
|
+
import { typeColor } from "@supersoniks/concorde/core/components/ui/_css/type";
|
|
13
13
|
let TableTd = class TableTd extends LitElement {
|
|
14
14
|
render() {
|
|
15
15
|
const styles = {
|
|
16
16
|
textAlign: this.align,
|
|
17
|
+
verticalAlign: this.vAlign,
|
|
17
18
|
minWidth: this.minWidth,
|
|
18
19
|
};
|
|
19
20
|
return html `<td
|
|
@@ -27,7 +28,7 @@ let TableTd = class TableTd extends LitElement {
|
|
|
27
28
|
}
|
|
28
29
|
};
|
|
29
30
|
TableTd.styles = [
|
|
30
|
-
|
|
31
|
+
typeColor,
|
|
31
32
|
css `
|
|
32
33
|
:host {
|
|
33
34
|
display: contents;
|
|
@@ -48,6 +49,9 @@ __decorate([
|
|
|
48
49
|
__decorate([
|
|
49
50
|
property({ type: String })
|
|
50
51
|
], TableTd.prototype, "align", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
property({ type: String })
|
|
54
|
+
], TableTd.prototype, "vAlign", void 0);
|
|
51
55
|
__decorate([
|
|
52
56
|
property({ type: String })
|
|
53
57
|
], TableTd.prototype, "minWidth", void 0);
|
|
@@ -8,7 +8,7 @@ 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 {
|
|
11
|
+
import { typeColor } from "@supersoniks/concorde/core/components/ui/_css/type";
|
|
12
12
|
const tagName = "sonic-th";
|
|
13
13
|
let TableTh = class TableTh extends LitElement {
|
|
14
14
|
render() {
|
|
@@ -27,7 +27,7 @@ let TableTh = class TableTh extends LitElement {
|
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
TableTh.styles = [
|
|
30
|
-
|
|
30
|
+
typeColor,
|
|
31
31
|
css `
|
|
32
32
|
:host {
|
|
33
33
|
display: contents;
|
|
@@ -6,7 +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 {
|
|
9
|
+
import { typeColor } from "@supersoniks/concorde/core/components/ui/_css/type";
|
|
10
10
|
const tagName = "sonic-tr";
|
|
11
11
|
let TableTr = class TableTr extends LitElement {
|
|
12
12
|
render() {
|
|
@@ -14,11 +14,12 @@ let TableTr = class TableTr extends LitElement {
|
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
16
|
TableTr.styles = [
|
|
17
|
-
|
|
17
|
+
typeColor,
|
|
18
18
|
css `
|
|
19
19
|
:host {
|
|
20
20
|
display: table-row;
|
|
21
21
|
}
|
|
22
|
+
|
|
22
23
|
`
|
|
23
24
|
];
|
|
24
25
|
TableTr = __decorate([
|
|
@@ -8,7 +8,7 @@ import "@supersoniks/concorde/core/components/ui/table/table-tfoot";
|
|
|
8
8
|
import "@supersoniks/concorde/core/components/ui/table/table-caption";
|
|
9
9
|
export declare class Table extends LitElement {
|
|
10
10
|
static styles: import("lit").CSSResult[];
|
|
11
|
-
size
|
|
11
|
+
size?: "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
12
12
|
striped: boolean;
|
|
13
13
|
sticky: boolean;
|
|
14
14
|
bordered: boolean;
|
|
@@ -15,11 +15,11 @@ import "@supersoniks/concorde/core/components/ui/table/table-thead";
|
|
|
15
15
|
import "@supersoniks/concorde/core/components/ui/table/table-tbody";
|
|
16
16
|
import "@supersoniks/concorde/core/components/ui/table/table-tfoot";
|
|
17
17
|
import "@supersoniks/concorde/core/components/ui/table/table-caption";
|
|
18
|
+
import { fontSize } from "@supersoniks/concorde/core/components/ui/_css/size";
|
|
18
19
|
const tagName = "sonic-table";
|
|
19
20
|
let Table = class Table extends LitElement {
|
|
20
21
|
constructor() {
|
|
21
22
|
super(...arguments);
|
|
22
|
-
this.size = "md";
|
|
23
23
|
this.striped = false;
|
|
24
24
|
this.sticky = false;
|
|
25
25
|
this.bordered = false;
|
|
@@ -41,6 +41,7 @@ let Table = class Table extends LitElement {
|
|
|
41
41
|
};
|
|
42
42
|
Table.styles = [
|
|
43
43
|
customScroll,
|
|
44
|
+
fontSize,
|
|
44
45
|
css `
|
|
45
46
|
:host {
|
|
46
47
|
--sc-table-fw: var(--sc-font-weight-base);
|
|
@@ -56,38 +57,20 @@ Table.styles = [
|
|
|
56
57
|
--sc-table-th-py: calc(1.8 * var(--sc-table-td-py) );
|
|
57
58
|
--sc-table-td-px: .5em;
|
|
58
59
|
--sc-table-td-py: .5em;
|
|
59
|
-
|
|
60
60
|
display:block;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
.table-container {
|
|
63
|
+
:host([maxHeight]) .table-container {
|
|
64
64
|
overflow-x: auto;
|
|
65
65
|
-webkit-overflow-scrolling: touch;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
.table {
|
|
69
69
|
width: 100%;
|
|
70
|
-
font-size: var(--sc-table-fs);
|
|
71
70
|
display: table;
|
|
72
71
|
box-sizing:border-box;
|
|
73
72
|
}
|
|
74
73
|
|
|
75
|
-
/*SIZES*/
|
|
76
|
-
:host([size="2xs"]) {
|
|
77
|
-
--sc-table-fs: 0.6rem;
|
|
78
|
-
}
|
|
79
|
-
:host([size="xs"]) {
|
|
80
|
-
--sc-table-fs: 0.75rem;
|
|
81
|
-
}
|
|
82
|
-
:host([size="sm"]) {
|
|
83
|
-
--sc-table-fs: 0.85rem;
|
|
84
|
-
}
|
|
85
|
-
:host([size="lg"]) {
|
|
86
|
-
--sc-table-fs: 1.2rem;
|
|
87
|
-
}
|
|
88
|
-
:host([size="xl"]) {
|
|
89
|
-
--sc-table-fs: 1.5rem;
|
|
90
|
-
}
|
|
91
74
|
:host([bordered]) .table-container {
|
|
92
75
|
border:var(--sc-border-width) solid var(--sc-table-border-color) !important;
|
|
93
76
|
}
|
|
File without changes
|
|
File without changes
|
|
@@ -20,35 +20,46 @@ export const coreVariables = css `
|
|
|
20
20
|
|
|
21
21
|
/* ROUNDED*/
|
|
22
22
|
--sc-rounded-sm: calc(var(--sc-rounded) * 0.5);
|
|
23
|
-
--sc-rounded: 0.
|
|
23
|
+
--sc-rounded: 0.375rem;
|
|
24
24
|
--sc-rounded-md: calc(var(--sc-rounded) * 1.8);
|
|
25
25
|
--sc-rounded-lg: calc(var(--sc-rounded) * 3.5);
|
|
26
26
|
--sc-rounded-xl: calc(var(--sc-rounded) * 7);
|
|
27
|
+
--sc-rounded-size-intensity: calc((1em - 1rem) * .4);
|
|
27
28
|
|
|
28
|
-
|
|
29
|
+
/* 4 for rounded full*/
|
|
30
|
+
--sc-btn-rounded-intensity : 1.4;
|
|
31
|
+
--sc-btn-font-weight: 500;
|
|
32
|
+
--sc-btn-rounded: calc((var(--sc-rounded) + var(--sc-rounded-size-intensity)) * var(--sc-btn-rounded-intensity) );
|
|
29
33
|
|
|
30
34
|
/* Placeholder */
|
|
31
35
|
--sc-placeholder-bg: rgba(17, 24, 39, 0.05);
|
|
32
36
|
|
|
33
|
-
/*
|
|
37
|
+
/* OMBRES */
|
|
34
38
|
--sc-shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
|
|
35
39
|
--sc-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
|
|
36
40
|
--sc-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
|
|
37
41
|
--sc-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
|
|
38
42
|
--sc-shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
|
|
39
43
|
|
|
40
|
-
/*
|
|
41
|
-
--sc-border-width: max(1px, 0.
|
|
44
|
+
/* Forms */
|
|
45
|
+
--sc-border-width: max(1px, 0.12rem);
|
|
46
|
+
--sc-form-height : 2.5em;
|
|
42
47
|
--sc-form-border-width: var(--sc-border-width);
|
|
43
48
|
--sc-input-bg: var(--sc-base-100);
|
|
44
49
|
--sc-input-border-color: var(--sc-input-bg);
|
|
45
|
-
--sc-input-rounded
|
|
50
|
+
--sc-input-rounded-intensity : 1.4;
|
|
51
|
+
--sc-input-rounded: calc((var(--sc-rounded) + var(--sc-rounded-size-intensity)) * var(--sc-input-rounded-intensity) );
|
|
52
|
+
--sc-label-font-weight: 500;
|
|
46
53
|
|
|
47
|
-
/*
|
|
54
|
+
/* Contrast -- ex : Text on images */
|
|
48
55
|
--sc-contrast-content: #fff;
|
|
49
|
-
--sc-contrast: #
|
|
56
|
+
--sc-contrast: #11151f;
|
|
50
57
|
|
|
51
58
|
/*Scrollbar*/
|
|
52
59
|
--sc-scrollbar-bg : var(--sc-base-400);
|
|
60
|
+
|
|
61
|
+
/*Body*/
|
|
62
|
+
--sc-body-bg: var(--sc-base);
|
|
63
|
+
|
|
53
64
|
}
|
|
54
65
|
`;
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
export declare class Theme extends LitElement {
|
|
3
3
|
static styles: import("lit").CSSResult[];
|
|
4
|
+
theme: string;
|
|
5
|
+
background: boolean;
|
|
6
|
+
color: boolean;
|
|
7
|
+
font: boolean;
|
|
8
|
+
contrastDarkMode: boolean;
|
|
4
9
|
connectedCallback(): void;
|
|
10
|
+
updated(): void;
|
|
5
11
|
postCSSVars(): void;
|
|
6
12
|
receiveMessage(event: any): void;
|
|
7
|
-
theme: string;
|
|
8
13
|
getCssVariables(): Record<string, string>;
|
|
14
|
+
contrast(color: string, percent: number): string;
|
|
15
|
+
contrastBg(): void;
|
|
9
16
|
render(): import("lit-html").TemplateResult<1>;
|
|
10
17
|
}
|
|
@@ -15,12 +15,19 @@ let Theme = Theme_1 = class Theme extends LitElement {
|
|
|
15
15
|
constructor() {
|
|
16
16
|
super(...arguments);
|
|
17
17
|
this.theme = "light";
|
|
18
|
+
this.background = false;
|
|
19
|
+
this.color = false;
|
|
20
|
+
this.font = false;
|
|
21
|
+
this.contrastDarkMode = false;
|
|
18
22
|
}
|
|
19
23
|
connectedCallback() {
|
|
20
24
|
super.connectedCallback();
|
|
21
25
|
window.addEventListener("message", (e) => this.receiveMessage(e), false);
|
|
22
26
|
this.postCSSVars();
|
|
23
27
|
}
|
|
28
|
+
updated() {
|
|
29
|
+
this.contrastBg();
|
|
30
|
+
}
|
|
24
31
|
postCSSVars() {
|
|
25
32
|
const stylesheets = document.styleSheets;
|
|
26
33
|
const ssLength = stylesheets.length;
|
|
@@ -68,6 +75,24 @@ let Theme = Theme_1 = class Theme extends LitElement {
|
|
|
68
75
|
names.forEach((name) => (result[name] = style.getPropertyValue(name)));
|
|
69
76
|
return result;
|
|
70
77
|
}
|
|
78
|
+
// function to darken a color based on an hexa value
|
|
79
|
+
contrast(color, percent) {
|
|
80
|
+
let num = parseInt(color.replace("#", ""), 16), amt = Math.round(2.55 * percent), R = (num >> 16) + amt, B = ((num >> 8) & 0x00ff) + amt, G = (num & 0x0000ff) + amt;
|
|
81
|
+
return ("#" +
|
|
82
|
+
(0x1000000 +
|
|
83
|
+
(R < 255 ? (R < 1 ? 0 : R) : 255) * 0x10000 +
|
|
84
|
+
(B < 255 ? (B < 1 ? 0 : B) : 255) * 0x100 +
|
|
85
|
+
(G < 255 ? (G < 1 ? 0 : G) : 255))
|
|
86
|
+
.toString(16)
|
|
87
|
+
.slice(1));
|
|
88
|
+
}
|
|
89
|
+
// get de computed value of --sc-base and darken it
|
|
90
|
+
contrastBg() {
|
|
91
|
+
if (this.theme === "dark" && this.contrastDarkMode && this.background) {
|
|
92
|
+
let baseColor = window.getComputedStyle(this).getPropertyValue("--sc-base");
|
|
93
|
+
this.style.setProperty("--sc-body-bg", this.contrast(baseColor, -2.5));
|
|
94
|
+
}
|
|
95
|
+
}
|
|
71
96
|
render() {
|
|
72
97
|
return html `<slot></slot>`;
|
|
73
98
|
}
|
|
@@ -79,7 +104,11 @@ Theme.styles = [
|
|
|
79
104
|
css `
|
|
80
105
|
:host([background]) {
|
|
81
106
|
display: block !important;
|
|
82
|
-
background: var(--sc-
|
|
107
|
+
background: var(--sc-body-bg) !important;
|
|
108
|
+
min-height: 100vh;
|
|
109
|
+
}
|
|
110
|
+
:host([contrastDarkMode]) {
|
|
111
|
+
transition: background-color 2.5s ease;
|
|
83
112
|
}
|
|
84
113
|
|
|
85
114
|
:host([color]) {
|
|
@@ -96,6 +125,18 @@ Theme.styles = [
|
|
|
96
125
|
__decorate([
|
|
97
126
|
property({ type: String, reflect: true })
|
|
98
127
|
], Theme.prototype, "theme", void 0);
|
|
128
|
+
__decorate([
|
|
129
|
+
property({ type: Boolean, reflect: true })
|
|
130
|
+
], Theme.prototype, "background", void 0);
|
|
131
|
+
__decorate([
|
|
132
|
+
property({ type: Boolean, reflect: true })
|
|
133
|
+
], Theme.prototype, "color", void 0);
|
|
134
|
+
__decorate([
|
|
135
|
+
property({ type: Boolean, reflect: true })
|
|
136
|
+
], Theme.prototype, "font", void 0);
|
|
137
|
+
__decorate([
|
|
138
|
+
property({ type: Boolean, reflect: true })
|
|
139
|
+
], Theme.prototype, "contrastDarkMode", void 0);
|
|
99
140
|
Theme = Theme_1 = __decorate([
|
|
100
141
|
customElement(tagName)
|
|
101
142
|
], Theme);
|
|
@@ -42,10 +42,11 @@ declare const Form: <T extends Constructor<FormElementInterface>>(superClass: T)
|
|
|
42
42
|
initPublisher(): void;
|
|
43
43
|
getFormPublisher(): any;
|
|
44
44
|
updateDataValue(): void;
|
|
45
|
-
|
|
45
|
+
handleBlur(e?: any): void;
|
|
46
|
+
error: boolean;
|
|
46
47
|
autofocus: boolean;
|
|
48
|
+
required: boolean;
|
|
47
49
|
disabled: true | null;
|
|
48
|
-
required: true | null;
|
|
49
50
|
formDataProvider: string;
|
|
50
51
|
props: any;
|
|
51
52
|
isConnected: boolean;
|
|
@@ -97,10 +97,13 @@ const Form = (superClass) => {
|
|
|
97
97
|
*/
|
|
98
98
|
getValueForFormPublisher() {
|
|
99
99
|
let publisher = this.getFormPublisher();
|
|
100
|
-
|
|
100
|
+
let currentValue = publisher[this.name].get();
|
|
101
|
+
if (this.radio) {
|
|
102
|
+
return this.checked && this.value != null ? this.value : currentValue;
|
|
103
|
+
}
|
|
104
|
+
if (this.unique) {
|
|
101
105
|
return this.checked && this.value != null ? this.value : null;
|
|
102
106
|
}
|
|
103
|
-
let currentValue = publisher[this.name].get();
|
|
104
107
|
if (!Array.isArray(currentValue)) {
|
|
105
108
|
currentValue = [];
|
|
106
109
|
}
|
|
@@ -4,11 +4,12 @@ export interface FormElementInterface extends SubscriberInterface {
|
|
|
4
4
|
getFormPublisher(): any;
|
|
5
5
|
updateDataValue(): void;
|
|
6
6
|
handleChange(e?: any): void;
|
|
7
|
+
handleBlur(e?: any): void;
|
|
7
8
|
getValueForFormPublisher(): any;
|
|
8
|
-
error:
|
|
9
|
+
error: boolean;
|
|
9
10
|
autofocus: boolean;
|
|
11
|
+
required: boolean;
|
|
10
12
|
disabled: true | null;
|
|
11
|
-
required: true | null;
|
|
12
13
|
formDataProvider: string;
|
|
13
14
|
_value: any;
|
|
14
15
|
get value(): any;
|
|
@@ -21,10 +21,10 @@ const Form = (superClass) => {
|
|
|
21
21
|
constructor(...args) {
|
|
22
22
|
super();
|
|
23
23
|
this.touched = false;
|
|
24
|
-
this.error =
|
|
24
|
+
this.error = false;
|
|
25
25
|
this.autofocus = false;
|
|
26
|
+
this.required = false;
|
|
26
27
|
this.disabled = null;
|
|
27
|
-
this.required = null;
|
|
28
28
|
this.onValueAssign = null;
|
|
29
29
|
this.onFormValueAssign = null;
|
|
30
30
|
this.onFormDataInValidate = null;
|
|
@@ -133,6 +133,10 @@ const Form = (superClass) => {
|
|
|
133
133
|
formPublisher.onInvalidate((this.onFormDataInValidate));
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
|
+
handleBlur() {
|
|
137
|
+
this.touched = true;
|
|
138
|
+
// this.validateFormElement();
|
|
139
|
+
}
|
|
136
140
|
handleChange(e) {
|
|
137
141
|
this.value = e.target.value;
|
|
138
142
|
const event = new Event("change");
|
|
@@ -230,10 +234,10 @@ const Form = (superClass) => {
|
|
|
230
234
|
], FormElement.prototype, "autofocus", void 0);
|
|
231
235
|
__decorate([
|
|
232
236
|
property({ type: Boolean })
|
|
233
|
-
], FormElement.prototype, "
|
|
237
|
+
], FormElement.prototype, "required", void 0);
|
|
234
238
|
__decorate([
|
|
235
239
|
property({ type: Boolean })
|
|
236
|
-
], FormElement.prototype, "
|
|
240
|
+
], FormElement.prototype, "disabled", void 0);
|
|
237
241
|
__decorate([
|
|
238
242
|
property()
|
|
239
243
|
], FormElement.prototype, "name", null);
|
|
@@ -8,22 +8,23 @@ declare const Form: <T extends Constructor<FormElementInterface>>(superClass: T)
|
|
|
8
8
|
* On peut essayer text, date, color, email par exemple, mais pas radio/checkbox/range a priori
|
|
9
9
|
*/
|
|
10
10
|
type: "button" | "checkbox" | "color" | "date" | "datetime-local" | "email" | "file" | "hidden" | "image" | "month" | "number" | "password" | "radio" | "range" | "reset" | "search" | "submit" | "tel" | "text" | "time" | "url" | "week";
|
|
11
|
-
tabindex
|
|
12
|
-
autocomplete
|
|
11
|
+
tabindex?: number | undefined;
|
|
12
|
+
autocomplete?: "url" | "name" | "language" | "on" | "tel" | "email" | "honorific-prefix" | "given-name" | "additional-name" | "family-name" | "honorific-suffix" | "nickname" | "username" | "new-password" | "current-password" | "one-time-code" | "organization-title" | "organization" | "street-address" | "address-line1" | "address-line2" | "address-line3" | "address-level4" | "address-level3" | "address-level2" | "address-level1" | "country" | "country-name" | "postal-code" | "cc-name" | "cc-given-name" | "cc-additional-name" | "cc-family-name" | "cc-number" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-csc" | "cc-type" | "transaction-currency" | "transaction-amount" | "bday" | "bday-day" | "bday-month" | "bday-year" | "sex" | "tel-country-code" | "tel-national" | "tel-area-code" | "tel-local" | "tel-extension" | "impp" | "photo" | undefined;
|
|
13
13
|
getFormPublisher(): any;
|
|
14
14
|
updateDataValue(): void;
|
|
15
15
|
handleChange(e?: any): void;
|
|
16
|
+
handleBlur(e?: any): void;
|
|
16
17
|
getValueForFormPublisher(): any;
|
|
17
|
-
error:
|
|
18
|
+
error: boolean;
|
|
18
19
|
autofocus: boolean;
|
|
20
|
+
required: boolean;
|
|
19
21
|
disabled: true | null;
|
|
20
|
-
required: true | null;
|
|
21
22
|
formDataProvider: string;
|
|
22
|
-
_value: any;
|
|
23
23
|
/**
|
|
24
24
|
* Le type De l'input, comme en html cependant tous les types ne sont pas actuellements compatibles en raison du style en vigueur
|
|
25
25
|
* On peut essayer text, date, color, email par exemple, mais pas radio/checkbox/range a priori
|
|
26
26
|
*/
|
|
27
|
+
_value: any;
|
|
27
28
|
value: any;
|
|
28
29
|
_name: string;
|
|
29
30
|
name: string;
|
package/core/mixins/FormInput.js
CHANGED
|
@@ -14,8 +14,6 @@ const Form = (superClass) => {
|
|
|
14
14
|
* On peut essayer text, date, color, email par exemple, mais pas radio/checkbox/range a priori
|
|
15
15
|
*/
|
|
16
16
|
this.type = "text";
|
|
17
|
-
this.tabindex = null;
|
|
18
|
-
this.autocomplete = null;
|
|
19
17
|
args;
|
|
20
18
|
}
|
|
21
19
|
validateFormElement() {
|
|
@@ -32,7 +30,7 @@ const Form = (superClass) => {
|
|
|
32
30
|
property({ type: String })
|
|
33
31
|
], FormInput.prototype, "type", void 0);
|
|
34
32
|
__decorate([
|
|
35
|
-
property({ type:
|
|
33
|
+
property({ type: Number })
|
|
36
34
|
], FormInput.prototype, "tabindex", void 0);
|
|
37
35
|
__decorate([
|
|
38
36
|
property({ type: String })
|
package/mixins.d.ts
CHANGED
|
@@ -55,10 +55,11 @@ export declare const FormCheckable: <T extends new (...args: any[]) => myFormEle
|
|
|
55
55
|
initPublisher(): void;
|
|
56
56
|
getFormPublisher(): any;
|
|
57
57
|
updateDataValue(): void;
|
|
58
|
-
|
|
58
|
+
handleBlur(e?: any): void;
|
|
59
|
+
error: boolean;
|
|
59
60
|
autofocus: boolean;
|
|
61
|
+
required: boolean;
|
|
60
62
|
disabled: true | null;
|
|
61
|
-
required: true | null;
|
|
62
63
|
formDataProvider: string;
|
|
63
64
|
props: any;
|
|
64
65
|
isConnected: boolean;
|
|
@@ -89,16 +90,17 @@ export declare const FormInput: <T extends new (...args: any[]) => myFormElement
|
|
|
89
90
|
new (...args: any[]): {
|
|
90
91
|
validateFormElement(): void;
|
|
91
92
|
type: "number" | "search" | "file" | "button" | "password" | "url" | "color" | "hidden" | "time" | "image" | "text" | "reset" | "submit" | "month" | "week" | "checkbox" | "radio" | "range" | "tel" | "email" | "date" | "datetime-local";
|
|
92
|
-
tabindex
|
|
93
|
-
autocomplete
|
|
93
|
+
tabindex?: number | undefined;
|
|
94
|
+
autocomplete?: "url" | "name" | "language" | "on" | "tel" | "email" | "honorific-prefix" | "given-name" | "additional-name" | "family-name" | "honorific-suffix" | "nickname" | "username" | "new-password" | "current-password" | "one-time-code" | "organization-title" | "organization" | "street-address" | "address-line1" | "address-line2" | "address-line3" | "address-level4" | "address-level3" | "address-level2" | "address-level1" | "country" | "country-name" | "postal-code" | "cc-name" | "cc-given-name" | "cc-additional-name" | "cc-family-name" | "cc-number" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-csc" | "cc-type" | "transaction-currency" | "transaction-amount" | "bday" | "bday-day" | "bday-month" | "bday-year" | "sex" | "tel-country-code" | "tel-national" | "tel-area-code" | "tel-local" | "tel-extension" | "impp" | "photo" | undefined;
|
|
94
95
|
getFormPublisher(): any;
|
|
95
96
|
updateDataValue(): void;
|
|
96
97
|
handleChange(e?: any): void;
|
|
98
|
+
handleBlur(e?: any): void;
|
|
97
99
|
getValueForFormPublisher(): any;
|
|
98
|
-
error:
|
|
100
|
+
error: boolean;
|
|
99
101
|
autofocus: boolean;
|
|
102
|
+
required: boolean;
|
|
100
103
|
disabled: true | null;
|
|
101
|
-
required: true | null;
|
|
102
104
|
formDataProvider: string;
|
|
103
105
|
_value: any;
|
|
104
106
|
value: any;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supersoniks/concorde",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.30",
|
|
4
4
|
"customElements": "custom-elements.json",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -56,8 +56,10 @@
|
|
|
56
56
|
"./functional/subscriber": "./core/components/functional/subscriber/subscriber.js",
|
|
57
57
|
"./core/components/ui/_css/scroll": "./core/components/ui/_css/scroll.js",
|
|
58
58
|
"./ui/_css/scroll": "./core/components/ui/_css/scroll.js",
|
|
59
|
-
"./core/components/ui/_css/
|
|
60
|
-
"./ui/_css/
|
|
59
|
+
"./core/components/ui/_css/size": "./core/components/ui/_css/size.js",
|
|
60
|
+
"./ui/_css/size": "./core/components/ui/_css/size.js",
|
|
61
|
+
"./core/components/ui/_css/type": "./core/components/ui/_css/type.js",
|
|
62
|
+
"./ui/_css/type": "./core/components/ui/_css/type.js",
|
|
61
63
|
"./core/components/ui/alert/alert": "./core/components/ui/alert/alert.js",
|
|
62
64
|
"./ui/alert": "./core/components/ui/alert/alert.js",
|
|
63
65
|
"./core/components/ui/badge/badge": "./core/components/ui/badge/badge.js",
|