@supersoniks/concorde 1.1.28 → 1.1.31
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 +23 -23
- package/concorde-core.es.js +23 -23
- package/core/components/functional/date/date.js +8 -2
- package/core/components/functional/list/list.js +17 -11
- package/core/components/functional/submit/submit.js +46 -30
- 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 +7 -16
- 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/captcha/captcha.d.ts +16 -0
- package/core/components/ui/captcha/captcha.js +54 -0
- 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 +51 -11
- 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/taxonomy/taxonomy.js +2 -1
- package/core/components/ui/theme/theme-collection/core-variables.js +19 -8
- package/core/components/ui/theme/theme.d.ts +9 -1
- package/core/components/ui/theme/theme.js +47 -2
- package/core/components/ui/toast/toast-item.js +25 -7
- package/core/components/ui/toast/toast.js +6 -2
- package/core/components/ui/ui.d.ts +1 -0
- package/core/components/ui/ui.js +1 -0
- package/core/mixins/Fetcher.js +4 -0
- package/core/mixins/FormCheckable.d.ts +3 -5
- 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 -9
- package/core/mixins/FormInput.js +1 -3
- package/core/utils/PublisherProxy.d.mts +1 -1
- package/core/utils/PublisherProxy.mjs +3 -3
- package/core/utils/api.js +4 -2
- package/mixins.d.ts +8 -6
- package/package.json +7 -3
- package/core/components/ui/_css/types.d.ts +0 -2
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
|
+
export declare const tailwind: import("lit").CSSResult;
|
|
2
3
|
export declare class Theme extends LitElement {
|
|
3
4
|
static styles: import("lit").CSSResult[];
|
|
5
|
+
theme: string;
|
|
6
|
+
background: boolean;
|
|
7
|
+
color: boolean;
|
|
8
|
+
font: boolean;
|
|
9
|
+
contrastDarkMode: boolean;
|
|
4
10
|
connectedCallback(): void;
|
|
11
|
+
updated(): void;
|
|
5
12
|
postCSSVars(): void;
|
|
6
13
|
receiveMessage(event: any): void;
|
|
7
|
-
theme: string;
|
|
8
14
|
getCssVariables(): Record<string, string>;
|
|
15
|
+
contrast(color: string, percent: number): string;
|
|
16
|
+
contrastBg(): void;
|
|
9
17
|
render(): import("lit-html").TemplateResult<1>;
|
|
10
18
|
}
|
|
@@ -5,22 +5,33 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
var Theme_1;
|
|
8
|
-
import { html, LitElement, css } from "lit";
|
|
8
|
+
import { html, LitElement, css, unsafeCSS } from "lit";
|
|
9
9
|
import { customElement, property } from "lit/decorators.js";
|
|
10
10
|
import { coreVariables } from "@supersoniks/concorde/core/components/ui/theme/theme-collection/core-variables";
|
|
11
11
|
import { light } from "@supersoniks/concorde/core/components/ui/theme/theme-collection/light";
|
|
12
12
|
import { dark } from "@supersoniks/concorde/core/components/ui/theme/theme-collection/dark";
|
|
13
|
+
import tailwindImport from "./css/tailwind.css?inline";
|
|
14
|
+
export const tailwind = css `
|
|
15
|
+
${unsafeCSS(tailwindImport)}
|
|
16
|
+
`;
|
|
13
17
|
const tagName = "sonic-theme";
|
|
14
18
|
let Theme = Theme_1 = class Theme extends LitElement {
|
|
15
19
|
constructor() {
|
|
16
20
|
super(...arguments);
|
|
17
21
|
this.theme = "light";
|
|
22
|
+
this.background = false;
|
|
23
|
+
this.color = false;
|
|
24
|
+
this.font = false;
|
|
25
|
+
this.contrastDarkMode = false;
|
|
18
26
|
}
|
|
19
27
|
connectedCallback() {
|
|
20
28
|
super.connectedCallback();
|
|
21
29
|
window.addEventListener("message", (e) => this.receiveMessage(e), false);
|
|
22
30
|
this.postCSSVars();
|
|
23
31
|
}
|
|
32
|
+
updated() {
|
|
33
|
+
this.contrastBg();
|
|
34
|
+
}
|
|
24
35
|
postCSSVars() {
|
|
25
36
|
const stylesheets = document.styleSheets;
|
|
26
37
|
const ssLength = stylesheets.length;
|
|
@@ -68,6 +79,24 @@ let Theme = Theme_1 = class Theme extends LitElement {
|
|
|
68
79
|
names.forEach((name) => (result[name] = style.getPropertyValue(name)));
|
|
69
80
|
return result;
|
|
70
81
|
}
|
|
82
|
+
// function to darken a color based on an hexa value
|
|
83
|
+
contrast(color, percent) {
|
|
84
|
+
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;
|
|
85
|
+
return ("#" +
|
|
86
|
+
(0x1000000 +
|
|
87
|
+
(R < 255 ? (R < 1 ? 0 : R) : 255) * 0x10000 +
|
|
88
|
+
(B < 255 ? (B < 1 ? 0 : B) : 255) * 0x100 +
|
|
89
|
+
(G < 255 ? (G < 1 ? 0 : G) : 255))
|
|
90
|
+
.toString(16)
|
|
91
|
+
.slice(1));
|
|
92
|
+
}
|
|
93
|
+
// get de computed value of --sc-base and darken it
|
|
94
|
+
contrastBg() {
|
|
95
|
+
if (this.theme === "dark" && this.contrastDarkMode && this.background) {
|
|
96
|
+
let baseColor = window.getComputedStyle(this).getPropertyValue("--sc-base");
|
|
97
|
+
this.style.setProperty("--sc-body-bg", this.contrast(baseColor, -2.5));
|
|
98
|
+
}
|
|
99
|
+
}
|
|
71
100
|
render() {
|
|
72
101
|
return html `<slot></slot>`;
|
|
73
102
|
}
|
|
@@ -79,7 +108,11 @@ Theme.styles = [
|
|
|
79
108
|
css `
|
|
80
109
|
:host([background]) {
|
|
81
110
|
display: block !important;
|
|
82
|
-
background: var(--sc-
|
|
111
|
+
background: var(--sc-body-bg) !important;
|
|
112
|
+
min-height: 100vh;
|
|
113
|
+
}
|
|
114
|
+
:host([contrastDarkMode]) {
|
|
115
|
+
transition: background-color 2.5s ease;
|
|
83
116
|
}
|
|
84
117
|
|
|
85
118
|
:host([color]) {
|
|
@@ -96,6 +129,18 @@ Theme.styles = [
|
|
|
96
129
|
__decorate([
|
|
97
130
|
property({ type: String, reflect: true })
|
|
98
131
|
], Theme.prototype, "theme", void 0);
|
|
132
|
+
__decorate([
|
|
133
|
+
property({ type: Boolean, reflect: true })
|
|
134
|
+
], Theme.prototype, "background", void 0);
|
|
135
|
+
__decorate([
|
|
136
|
+
property({ type: Boolean, reflect: true })
|
|
137
|
+
], Theme.prototype, "color", void 0);
|
|
138
|
+
__decorate([
|
|
139
|
+
property({ type: Boolean, reflect: true })
|
|
140
|
+
], Theme.prototype, "font", void 0);
|
|
141
|
+
__decorate([
|
|
142
|
+
property({ type: Boolean, reflect: true })
|
|
143
|
+
], Theme.prototype, "contrastDarkMode", void 0);
|
|
99
144
|
Theme = Theme_1 = __decorate([
|
|
100
145
|
customElement(tagName)
|
|
101
146
|
], Theme);
|
|
@@ -46,7 +46,7 @@ let SonicToastItem = class SonicToastItem extends LitElement {
|
|
|
46
46
|
>
|
|
47
47
|
|
|
48
48
|
<button aria-label="Close" class="sonic-toast-close" @click=${() => this.hide()}>
|
|
49
|
-
|
|
49
|
+
<sonic-icon name="cancel" size="lg"></sonic-icon>
|
|
50
50
|
</button>
|
|
51
51
|
<div class="sonic-toast-content custom-scroll" style="max-height: ${this.maxHeight} ;">
|
|
52
52
|
|
|
@@ -55,8 +55,8 @@ let SonicToastItem = class SonicToastItem extends LitElement {
|
|
|
55
55
|
|
|
56
56
|
|
|
57
57
|
<div class="sonic-toast-text">
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
${this.title ? html `<div class="sonic-toast-title">${this.title}</div>` : ""}
|
|
59
|
+
${this.text ? unsafeHTML(this.text) : ""}
|
|
60
60
|
<slot></slot>
|
|
61
61
|
</div>
|
|
62
62
|
|
|
@@ -124,7 +124,7 @@ SonicToastItem.styles = [
|
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
.sonic-toast-content {
|
|
127
|
-
padding: 1em
|
|
127
|
+
padding: 1em 2.5rem 1em 1em;
|
|
128
128
|
display: flex;
|
|
129
129
|
gap: 0.5rem;
|
|
130
130
|
overflow: auto;
|
|
@@ -136,15 +136,32 @@ SonicToastItem.styles = [
|
|
|
136
136
|
margin-top: auto;
|
|
137
137
|
margin-bottom: auto;
|
|
138
138
|
max-width:70ch;
|
|
139
|
+
line-height: 1.2;
|
|
139
140
|
}
|
|
140
141
|
|
|
141
|
-
::slotted(a),
|
|
142
|
+
::slotted(a:not(.btn)),
|
|
142
143
|
.sonic-toast-text a {
|
|
143
|
-
color: inherit;
|
|
144
|
-
text-decoration: underline;
|
|
144
|
+
color: inherit !important;
|
|
145
|
+
text-decoration: underline !important;
|
|
145
146
|
text-underline-offset: 0.15rem;
|
|
146
147
|
}
|
|
147
148
|
|
|
149
|
+
::slotted(:is(p, ul, ol, hr, h1, h2, h3, h4, h5, h6)),
|
|
150
|
+
.sonic-toast-text :is(p, ul, ol, hr, h1, h2, h3, h4, h5, h6) {
|
|
151
|
+
margin: 0 0 0.3em !important;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
::slotted(li),
|
|
155
|
+
.sonic-toast-text li {
|
|
156
|
+
margin-bottom: .15em !important;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
::slotted( :is(p, ul, ol, hr, h1, h2, h3, h4, h5, h6):last-child),
|
|
160
|
+
.sonic-toast-text > :is(p, ul, ol, hr, h1, h2, h3, h4, h5, h6):last-child {
|
|
161
|
+
margin-bottom: 0 !important;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
|
|
148
165
|
/*BUTTON CLOSE*/
|
|
149
166
|
.sonic-toast-close {
|
|
150
167
|
all: unset;
|
|
@@ -183,6 +200,7 @@ SonicToastItem.styles = [
|
|
|
183
200
|
font-weight: bold;
|
|
184
201
|
font-size: 1.15rem;
|
|
185
202
|
margin: 0.15em 0 0.25em;
|
|
203
|
+
line-height: 1.2;
|
|
186
204
|
}
|
|
187
205
|
|
|
188
206
|
/*STATUS*/
|
|
@@ -10,6 +10,7 @@ import { repeat } from "lit/directives/repeat.js";
|
|
|
10
10
|
import { animate } from "@lit-labs/motion";
|
|
11
11
|
import Objects from "@supersoniks/concorde/core/utils/Objects";
|
|
12
12
|
import "@supersoniks/concorde/core/components/ui/icon/icon";
|
|
13
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
13
14
|
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
14
15
|
import { styleMap } from "lit/directives/style-map.js";
|
|
15
16
|
import "@supersoniks/concorde/core/components/ui/toast/toast-item";
|
|
@@ -39,10 +40,12 @@ let SonicToast = class SonicToast extends LitElement {
|
|
|
39
40
|
return html `<div aria-live="polite" style=${styleMap(styles)}>
|
|
40
41
|
${repeat(this.toasts, (item) => item.id, (item) => html `
|
|
41
42
|
<sonic-toast-item maxHeight=${isIframe ? 'none' : '10rem'}
|
|
42
|
-
status=${item.status}
|
|
43
|
+
status=${ifDefined(item.status)}
|
|
44
|
+
title=${ifDefined(item.title)}
|
|
43
45
|
?ghost=${item.ghost}
|
|
44
46
|
?dismissForever=${item.dismissForever}
|
|
45
|
-
?preserve=${item.preserve}
|
|
47
|
+
?preserve=${item.preserve}
|
|
48
|
+
id=${ifDefined(item.id)}
|
|
46
49
|
@hide=${() => this.removeItem(item)}
|
|
47
50
|
${animate({
|
|
48
51
|
keyframeOptions: {
|
|
@@ -61,6 +64,7 @@ let SonicToast = class SonicToast extends LitElement {
|
|
|
61
64
|
stabilizeOut: true,
|
|
62
65
|
})}
|
|
63
66
|
>
|
|
67
|
+
<!-- Le texte est passé dans le slot et non pas en propriété pour contrer des problèmatiques de shadow-dom et d'appel exterieur (exemple: fancybox) -->
|
|
64
68
|
${item.text ? unsafeHTML(item.text) : ""}
|
|
65
69
|
</sonic-toast-item>
|
|
66
70
|
`)}
|
package/core/components/ui/ui.js
CHANGED
package/core/mixins/Fetcher.js
CHANGED
|
@@ -86,6 +86,7 @@ const Fetcher = (superClass) => {
|
|
|
86
86
|
Loader.show();
|
|
87
87
|
let headerData = PublisherManager.getInstance().get(this.getAncestorAttributeValue("headersDataProvider")).get();
|
|
88
88
|
data = yield this.api.get(this.endPoint || this.dataProvider || "", headerData);
|
|
89
|
+
// Je garde ça mais normalement ça n'arrive jamais
|
|
89
90
|
if (!data) {
|
|
90
91
|
SonicToast.add({ text: "Network Error", status: "error" });
|
|
91
92
|
this.isLoading = false;
|
|
@@ -96,7 +97,10 @@ const Fetcher = (superClass) => {
|
|
|
96
97
|
if (hasLoader)
|
|
97
98
|
Loader.hide();
|
|
98
99
|
if (this.key) {
|
|
100
|
+
let response = data._sonic_http_response_;
|
|
99
101
|
data = Objects.traverse(data, this.key.split("."), false);
|
|
102
|
+
if (data)
|
|
103
|
+
data._sonic_http_response_ = response;
|
|
100
104
|
}
|
|
101
105
|
this.props = data;
|
|
102
106
|
this.dispatchEvent(new CustomEvent("load", { detail: this }));
|
|
@@ -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;
|
|
@@ -67,9 +68,6 @@ declare const Form: <T extends Constructor<FormElementInterface>>(superClass: T)
|
|
|
67
68
|
requestUpdate(): void;
|
|
68
69
|
getAttribute(name: string): string;
|
|
69
70
|
hasAttribute(attributeName: String): boolean;
|
|
70
|
-
/**
|
|
71
|
-
* comme radio,mais peut être désélectionné après sélection
|
|
72
|
-
*/
|
|
73
71
|
disconnectedCallback(): void;
|
|
74
72
|
};
|
|
75
73
|
} & T;
|
|
@@ -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,31 +8,28 @@ 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;
|
|
30
31
|
props: any;
|
|
31
32
|
isConnected: boolean;
|
|
32
|
-
/**
|
|
33
|
-
* Le type De l'input, comme en html cependant tous les types ne sont pas actuellements compatibles en raison du style en vigueur
|
|
34
|
-
* On peut essayer text, date, color, email par exemple, mais pas radio/checkbox/range a priori
|
|
35
|
-
*/
|
|
36
33
|
getAncestorAttributeValue(attributeName: string): string;
|
|
37
34
|
hasAncestorAttribute(attributeName: string): boolean;
|
|
38
35
|
querySelectorAll(selector: string): NodeListOf<Element>;
|
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 })
|
|
@@ -199,7 +199,7 @@ export class PublisherProxy {
|
|
|
199
199
|
* Si il s'agit d'une valeur primitive (un entier, une chaine ) la valeure en renseignée par un objet contenant la vaeur {__value}
|
|
200
200
|
* On publie juste et on sen va.
|
|
201
201
|
*/
|
|
202
|
-
const isPrimitiveValue =
|
|
202
|
+
const isPrimitiveValue = this._value_.hasOwnProperty("__value");
|
|
203
203
|
if (isPrimitiveValue) {
|
|
204
204
|
this._publishAssignement_(lockInternalMutationsTransmission);
|
|
205
205
|
return true;
|
|
@@ -222,7 +222,7 @@ export class PublisherProxy {
|
|
|
222
222
|
* Si la donnée est complexe (objet, tableau)
|
|
223
223
|
* on crée les proxys pour les sous-éléments qui n'en on pas
|
|
224
224
|
* On renseigne les nouvelles valeurs internes des proxies
|
|
225
|
-
|
|
225
|
+
*/
|
|
226
226
|
if (isComplex(this._value_)) {
|
|
227
227
|
for (let key in this._value_) {
|
|
228
228
|
let v = newValue[key];
|
|
@@ -258,7 +258,7 @@ export class PublisherProxy {
|
|
|
258
258
|
* Utilitaires de gestion des Publisher
|
|
259
259
|
* Obtenir, replacer ou supprimer un Publisher
|
|
260
260
|
*
|
|
261
|
-
*/
|
|
261
|
+
*/
|
|
262
262
|
export class PublisherManager {
|
|
263
263
|
constructor() {
|
|
264
264
|
if (PublisherManager.instance != null)
|
package/core/utils/api.js
CHANGED
|
@@ -52,10 +52,11 @@ class API {
|
|
|
52
52
|
let result = yield fetch(url, { headers: headers });
|
|
53
53
|
try {
|
|
54
54
|
let json = yield result.json();
|
|
55
|
+
json._sonic_http_response_ = result;
|
|
55
56
|
resolve(json);
|
|
56
57
|
}
|
|
57
58
|
catch (e) {
|
|
58
|
-
resolve(
|
|
59
|
+
resolve({ _sonic_http_response_: result });
|
|
59
60
|
}
|
|
60
61
|
}));
|
|
61
62
|
API.loadingGetPromises.set(url, promise);
|
|
@@ -105,10 +106,11 @@ class API {
|
|
|
105
106
|
});
|
|
106
107
|
try {
|
|
107
108
|
let json = yield result.json();
|
|
109
|
+
json._sonic_http_response_ = result;
|
|
108
110
|
return json;
|
|
109
111
|
}
|
|
110
112
|
catch (e) {
|
|
111
|
-
return
|
|
113
|
+
return { _sonic_http_response_: result };
|
|
112
114
|
}
|
|
113
115
|
});
|
|
114
116
|
}
|
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.31",
|
|
4
4
|
"customElements": "custom-elements.json",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -56,14 +56,18 @@
|
|
|
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",
|
|
64
66
|
"./ui/badge": "./core/components/ui/badge/badge.js",
|
|
65
67
|
"./core/components/ui/button/button": "./core/components/ui/button/button.js",
|
|
66
68
|
"./ui/button": "./core/components/ui/button/button.js",
|
|
69
|
+
"./core/components/ui/captcha/captcha": "./core/components/ui/captcha/captcha.js",
|
|
70
|
+
"./ui/captcha": "./core/components/ui/captcha/captcha.js",
|
|
67
71
|
"./core/components/ui/card/card-footer": "./core/components/ui/card/card-footer.js",
|
|
68
72
|
"./ui/card/card-footer": "./core/components/ui/card/card-footer.js",
|
|
69
73
|
"./core/components/ui/card/card-header-descripton": "./core/components/ui/card/card-header-descripton.js",
|