@supersoniks/concorde 1.1.43 → 1.1.44
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 +18 -18
- package/concorde-core.es.js +805 -739
- package/core/_types/types.d.ts +13 -8
- package/core/_types/types.js +1 -0
- package/core/components/functional/date/date.d.ts +2 -2
- package/core/components/functional/date/date.js +10 -10
- package/core/components/functional/example/example.d.ts +1 -1
- package/core/components/functional/fetch/fetch.d.ts +8 -6
- package/core/components/functional/list/list.d.ts +16 -8
- package/core/components/functional/list/list.js +25 -13
- package/core/components/functional/mix/mix.d.ts +5 -5
- package/core/components/functional/mix/mix.js +11 -8
- package/core/components/functional/queue/queue.d.ts +12 -3
- package/core/components/functional/queue/queue.js +28 -22
- package/core/components/functional/router/redirect.d.ts +2 -2
- package/core/components/functional/router/redirect.js +2 -6
- package/core/components/functional/router/router.d.ts +1 -1
- package/core/components/functional/router/router.js +10 -10
- package/core/components/functional/sdui/SDUIDescriptorTransformer.d.ts +0 -1
- package/core/components/functional/sdui/SDUIDescriptorTransformer.js +35 -36
- package/core/components/functional/sdui/sdui-utils.js +11 -11
- package/core/components/functional/sdui/sdui.d.ts +10 -9
- package/core/components/functional/sdui/sdui.js +32 -33
- package/core/components/functional/sdui/types.d.ts +8 -8
- package/core/components/functional/states/states.d.ts +3 -3
- package/core/components/functional/states/states.js +8 -8
- package/core/components/functional/submit/submit.d.ts +1 -1
- package/core/components/functional/submit/submit.js +16 -16
- package/core/components/functional/subscriber/subscriber.d.ts +1 -1
- package/core/components/functional/value/value.d.ts +1 -1
- package/core/components/ui/_css/size.d.ts +1 -1
- package/core/components/ui/button/button.d.ts +6 -4
- package/core/components/ui/button/button.js +2 -2
- package/core/components/ui/captcha/captcha.d.ts +2 -2
- package/core/components/ui/captcha/captcha.js +2 -2
- package/core/components/ui/card/card-header.js +5 -1
- package/core/components/ui/card/card.js +7 -5
- package/core/components/ui/form/checkbox/checkbox.d.ts +36 -12
- package/core/components/ui/form/fieldset/fieldset.d.ts +1 -1
- package/core/components/ui/form/form-layout/form-layout.d.ts +1 -1
- package/core/components/ui/form/input/input.d.ts +14 -9
- package/core/components/ui/form/input/input.js +2 -2
- package/core/components/ui/form/input/password-helper.d.ts +1 -1
- package/core/components/ui/form/input/password-helper.js +1 -1
- package/core/components/ui/form/input/same-value-helper.d.ts +1 -1
- package/core/components/ui/form/input/same-value-helper.js +2 -2
- package/core/components/ui/form/input-autocomplete/input-autocomplete.d.ts +1 -1
- package/core/components/ui/form/select/select.d.ts +5 -4
- package/core/components/ui/form/select/select.js +8 -8
- package/core/components/ui/form/textarea/textarea.d.ts +11 -9
- package/core/components/ui/form/textarea/textarea.js +1 -1
- package/core/components/ui/group/group.js +1 -1
- package/core/components/ui/icon/icons.js +15 -13
- package/core/components/ui/loader/loader.d.ts +1 -1
- package/core/components/ui/loader/loader.js +1 -1
- package/core/components/ui/menu/menu.js +15 -16
- package/core/components/ui/modal/modal.d.ts +1 -1
- package/core/components/ui/modal/modal.js +1 -1
- package/core/components/ui/pop/pop.d.ts +1 -1
- package/core/components/ui/pop/pop.js +13 -13
- package/core/components/ui/table/table-tbody.js +1 -1
- package/core/components/ui/theme/theme.js +15 -13
- package/core/components/ui/toast/message-subscriber.d.ts +12 -9
- package/core/components/ui/toast/message-subscriber.js +10 -8
- package/core/components/ui/toast/toast.d.ts +1 -1
- package/core/components/ui/toast/toast.js +7 -8
- package/core/components/ui/toast/types.d.ts +3 -2
- package/core/components/ui/tooltip/tooltip.js +1 -1
- package/core/components/ui/ui.d.ts +1 -1
- package/core/components/ui/ui.js +1 -1
- package/core/mixins/Fetcher.d.ts +15 -17
- package/core/mixins/Fetcher.js +19 -10
- package/core/mixins/FormCheckable.d.ts +8 -5
- package/core/mixins/FormCheckable.js +21 -19
- package/core/mixins/FormElement.d.ts +10 -7
- package/core/mixins/FormElement.js +24 -23
- package/core/mixins/FormInput.d.ts +16 -10
- package/core/mixins/FormInput.js +1 -1
- package/core/mixins/Subscriber.d.ts +8 -6
- package/core/mixins/Subscriber.js +19 -18
- package/core/mixins/TemplatesContainer.d.ts +2 -1
- package/core/mixins/TemplatesContainer.js +2 -2
- package/core/utils/Arrays.js +12 -9
- package/core/utils/DataBindObserver.d.ts +4 -4
- package/core/utils/DataBindObserver.js +26 -28
- package/core/utils/HTML.d.ts +1 -1
- package/core/utils/HTML.js +2 -2
- package/core/utils/LocationHandler.js +10 -10
- package/core/utils/Objects.js +10 -4
- package/core/utils/PublisherProxy.d.ts +21 -15
- package/core/utils/PublisherProxy.js +67 -63
- package/core/utils/api.d.ts +16 -31
- package/core/utils/api.js +26 -22
- package/mixins.d.ts +25 -19
- package/package.json +9 -5
- package/core/components/ui/taxonomy/taxonomy.d.ts +0 -44
- package/core/components/ui/taxonomy/taxonomy.js +0 -115
|
@@ -62,7 +62,7 @@ let Submit = class Submit extends Subscriber(LitElement) {
|
|
|
62
62
|
if (!form)
|
|
63
63
|
return;
|
|
64
64
|
const formDataProvider = this.getAncestorAttributeValue("formDataProvider");
|
|
65
|
-
|
|
65
|
+
const formData = PublisherManager.get(formDataProvider).get();
|
|
66
66
|
for (const name in formData) {
|
|
67
67
|
if (name == "isFormValid")
|
|
68
68
|
continue;
|
|
@@ -84,7 +84,7 @@ let Submit = class Submit extends Subscriber(LitElement) {
|
|
|
84
84
|
control.value = value;
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
|
|
87
|
+
const submitButton = document.createElement("input");
|
|
88
88
|
submitButton.name = this.name;
|
|
89
89
|
submitButton.style.display = "none";
|
|
90
90
|
submitButton.value = this.value;
|
|
@@ -107,16 +107,16 @@ let Submit = class Submit extends Subscriber(LitElement) {
|
|
|
107
107
|
this.publisher.disabled = true;
|
|
108
108
|
formPublisher.isFormValid;
|
|
109
109
|
// support native html form
|
|
110
|
-
|
|
110
|
+
const native = this.hasAttribute("native");
|
|
111
111
|
if (native) {
|
|
112
112
|
this.submitNativeForm();
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
115
|
//
|
|
116
116
|
//Recup données
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
117
|
+
const method = ((_a = this.getAttribute("method")) === null || _a === void 0 ? void 0 : _a.toLocaleLowerCase()) || "post";
|
|
118
|
+
const sendAsFormData = this.hasAttribute("sendAsFormData");
|
|
119
|
+
const formData = formPublisher.get();
|
|
120
120
|
delete formData.isFormValid;
|
|
121
121
|
const headesDataProvider = this.getAncestorAttributeValue("headersDataProvider");
|
|
122
122
|
const headerPublisher = headesDataProvider ? PublisherManager.getInstance().get(headesDataProvider) : null;
|
|
@@ -124,10 +124,10 @@ let Submit = class Submit extends Subscriber(LitElement) {
|
|
|
124
124
|
if (headerPublisher)
|
|
125
125
|
headerData = headerPublisher.get();
|
|
126
126
|
let result = null;
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
const dataProvider = this.getAncestorAttributeValue("dataProvider");
|
|
128
|
+
const endPoint = this.endPoint || dataProvider;
|
|
129
129
|
Loader.show();
|
|
130
|
-
|
|
130
|
+
const sendData = () => __awaiter(this, void 0, void 0, function* () {
|
|
131
131
|
var _d, _e, _f, _g, _h, _j, _k;
|
|
132
132
|
//
|
|
133
133
|
//envoi données
|
|
@@ -156,25 +156,25 @@ let Submit = class Submit extends Subscriber(LitElement) {
|
|
|
156
156
|
// Si result ne contient que la réponse HTTP, avec un status not ok, on ajoute un message
|
|
157
157
|
else if (result._sonic_http_response_ && !result._sonic_http_response_.ok && Object.keys(result).length === 1)
|
|
158
158
|
result.messages = [{ content: "Network Error", status: "error" }];
|
|
159
|
-
|
|
159
|
+
const clearedDataProvider = this.getAncestorAttributeValue("clearedDataOnSuccess");
|
|
160
160
|
if (clearedDataProvider) {
|
|
161
161
|
clearedDataProvider.split(" ").forEach((dataProvider) => PublisherManager.get(dataProvider).set({}));
|
|
162
162
|
}
|
|
163
|
-
|
|
164
|
-
|
|
163
|
+
const username_key = this.hasAttribute("usernameKey") ? this.getAttribute("usernameKey") : "username";
|
|
164
|
+
const password_key = this.hasAttribute("passwordKey") ? this.getAttribute("passwordKey") : "password";
|
|
165
165
|
if (((_k = (_j = this.api) === null || _j === void 0 ? void 0 : _j.lastResult) === null || _k === void 0 ? void 0 : _k.ok) && formData[username_key] && formData[password_key]) {
|
|
166
166
|
this.saveCredentials(formData[username_key], formData[password_key]);
|
|
167
167
|
}
|
|
168
168
|
if (this.submitResultKey) {
|
|
169
169
|
result = Objects.traverse(result, this.submitResultKey.split("."), true);
|
|
170
170
|
}
|
|
171
|
-
|
|
171
|
+
const submitResultDataProvider = this.getAncestorAttributeValue("submitResultDataProvider");
|
|
172
172
|
if (submitResultDataProvider)
|
|
173
173
|
PublisherManager.get(submitResultDataProvider).set(result);
|
|
174
174
|
if (this.publisher)
|
|
175
175
|
this.publisher.disabled = null;
|
|
176
176
|
});
|
|
177
|
-
|
|
177
|
+
const captchaPublisher = (headerPublisher === null || headerPublisher === void 0 ? void 0 : headerPublisher.needsCaptchaValidation.get())
|
|
178
178
|
? headerPublisher
|
|
179
179
|
: formPublisher.needsCaptchaValidation.get()
|
|
180
180
|
? formPublisher
|
|
@@ -184,7 +184,7 @@ let Submit = class Submit extends Subscriber(LitElement) {
|
|
|
184
184
|
captchaPublisher.captchaAction =
|
|
185
185
|
(_c = (_b = dataProvider === null || dataProvider === void 0 ? void 0 : dataProvider.split("?")[0]) !== null && _b !== void 0 ? _b : this.getAncestorAttributeValue("formDataProvider")) !== null && _c !== void 0 ? _c : "submit";
|
|
186
186
|
captchaPublisher.captchaToken = "request_token";
|
|
187
|
-
|
|
187
|
+
const captchaAssign = (token) => {
|
|
188
188
|
if (token != "request_token") {
|
|
189
189
|
sendData();
|
|
190
190
|
// Après l'envoie des données, on supprime ce onAssign.
|
|
@@ -203,7 +203,7 @@ let Submit = class Submit extends Subscriber(LitElement) {
|
|
|
203
203
|
return __awaiter(this, void 0, void 0, function* () {
|
|
204
204
|
// Check if the browser supports password credentials (and the Credential Management API)
|
|
205
205
|
if ("PasswordCredential" in window) {
|
|
206
|
-
|
|
206
|
+
const credential = new window.PasswordCredential({
|
|
207
207
|
id: username,
|
|
208
208
|
// name: "Carina Anand", // In case of a login, the name comes from the server.
|
|
209
209
|
password: password,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LitElement, PropertyValues } from "lit";
|
|
2
|
-
declare const SonicSubscriber_base: (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<
|
|
2
|
+
declare const SonicSubscriber_base: (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<import("../../../_types/types").CoreJSType>) & typeof LitElement;
|
|
3
3
|
/**
|
|
4
4
|
* Voir la partie dédiée dans *MISCALLENOUS*
|
|
5
5
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
|
-
declare const SonicValue_base: (new (...args: any[]) => import("../../../mixins/Subscriber").SubscriberInterface<
|
|
2
|
+
declare const SonicValue_base: (new (...args: any[]) => import("../../../mixins/Subscriber").SubscriberInterface<import("../../../_types/types").CoreJSType>) & typeof LitElement;
|
|
3
3
|
export declare class SonicValue extends SonicValue_base {
|
|
4
4
|
connectedCallback(): void;
|
|
5
5
|
render(): import("lit-html").TemplateResult<1>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type Size = "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
2
2
|
export declare const fontSize: import("lit").CSSResult;
|
|
@@ -34,9 +34,11 @@ declare const Button_base: {
|
|
|
34
34
|
ariaLabel?: string | undefined;
|
|
35
35
|
_name: string;
|
|
36
36
|
name: string;
|
|
37
|
-
props:
|
|
38
|
-
propertyMap:
|
|
37
|
+
props: import("../../../_types/types").CoreJSType;
|
|
38
|
+
propertyMap: object;
|
|
39
39
|
isConnected: boolean;
|
|
40
|
+
children: HTMLCollection;
|
|
41
|
+
appendChild(node: Node): Node;
|
|
40
42
|
getAncestorAttributeValue(attributeName: string): string;
|
|
41
43
|
hasAncestorAttribute(attributeName: string): boolean;
|
|
42
44
|
querySelectorAll(selector: string): NodeListOf<Element>;
|
|
@@ -55,9 +57,9 @@ declare const Button_base: {
|
|
|
55
57
|
getApiConfiguration(): import("../../../utils/api").APIConfiguration;
|
|
56
58
|
requestUpdate(): void;
|
|
57
59
|
getAttribute(name: string): string;
|
|
58
|
-
hasAttribute(attributeName:
|
|
60
|
+
hasAttribute(attributeName: string): boolean;
|
|
59
61
|
};
|
|
60
|
-
} & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/FormElement").FormElementInterface) & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<
|
|
62
|
+
} & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/FormElement").FormElementInterface) & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<import("../../../_types/types").CoreJSType>) & typeof LitElement;
|
|
61
63
|
/**
|
|
62
64
|
* Un bouton simple avec deux slots, un nommé préfix et un nomé suffix de manière à pouvoir mettre (par exemple) une icone avant ou après le contenu.
|
|
63
65
|
* * L'objet et ses slot sont en display flex avec direction / alignement et justifications configurables
|
|
@@ -102,7 +102,7 @@ let Button = class Button extends FormCheckable(FormElement(Subscriber(LitElemen
|
|
|
102
102
|
LocationHandler.changeFromComponent(this);
|
|
103
103
|
}
|
|
104
104
|
handleChange(e) {
|
|
105
|
-
super.handleChange(
|
|
105
|
+
super.handleChange();
|
|
106
106
|
if (this.pushState || this.goBack !== null) {
|
|
107
107
|
e === null || e === void 0 ? void 0 : e.preventDefault();
|
|
108
108
|
e === null || e === void 0 ? void 0 : e.stopPropagation();
|
|
@@ -113,7 +113,7 @@ let Button = class Button extends FormCheckable(FormElement(Subscriber(LitElemen
|
|
|
113
113
|
* On on veut pouvoir rest un autre form que celui qui contient le bouton
|
|
114
114
|
*/
|
|
115
115
|
const resetDataProvider = this.getAttribute("reset");
|
|
116
|
-
|
|
116
|
+
const formPublisher = resetDataProvider ? PublisherManager.get(resetDataProvider) : this.getFormPublisher();
|
|
117
117
|
if (formPublisher)
|
|
118
118
|
formPublisher.set({});
|
|
119
119
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
|
-
|
|
2
|
+
type AssignListener = {
|
|
3
3
|
onAssign: (listener: (value: string) => void) => void;
|
|
4
4
|
};
|
|
5
|
-
declare const Captcha_base: (new (...args: any[]) => import("../../../mixins/Subscriber").SubscriberInterface<
|
|
5
|
+
declare const Captcha_base: (new (...args: any[]) => import("../../../mixins/Subscriber").SubscriberInterface<import("@supersoniks/concorde/core/_types/types").CoreJSType>) & typeof LitElement;
|
|
6
6
|
/**
|
|
7
7
|
* Un bouton simple avec deux slots, un nommé préfix et un nomé suffix de manière à pouvoir mettre (par exemple) une icone avant ou après le contenu.
|
|
8
8
|
* * L'objet et ses slot sont en display flex avec direction / alignement et justifications configurables
|
|
@@ -43,8 +43,8 @@ let Captcha = class Captcha extends Subscriber(LitElement) {
|
|
|
43
43
|
return;
|
|
44
44
|
// On récupère l'action liée au recaptcha,
|
|
45
45
|
// et on vérifie qu'il ne contienne que des caractères alpha-numériques, underscore et slash
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
const action = ((_c = (_a = this.action) !== null && _a !== void 0 ? _a : (_b = this.formPublisher.captchaAction) === null || _b === void 0 ? void 0 : _b.get()) !== null && _c !== void 0 ? _c : "submit").replace(/[^\w_/]/g, "_");
|
|
47
|
+
const method = ((_e = (_d = this.formPublisher.captchaMethod) === null || _d === void 0 ? void 0 : _d.get()) !== null && _e !== void 0 ? _e : "POST").toUpperCase();
|
|
48
48
|
delete this.formPublisher.captchaAction;
|
|
49
49
|
delete this.formPublisher.captchaMethod;
|
|
50
50
|
window.grecaptcha.ready(() => {
|
|
@@ -35,7 +35,11 @@ CardHeader.styles = [
|
|
|
35
35
|
--sc-card-header-family: var(--sc-headings-font-family);
|
|
36
36
|
--sc-card-header-line-height: var(--sc-headings-line-height);
|
|
37
37
|
}
|
|
38
|
-
|
|
38
|
+
@media print {
|
|
39
|
+
:host {
|
|
40
|
+
--sc-card-header-font-size: 1.45rem;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
39
43
|
.header {
|
|
40
44
|
display: flex;
|
|
41
45
|
align-items: flex-start;
|
|
@@ -28,6 +28,9 @@ let Card = class Card extends LitElement {
|
|
|
28
28
|
};
|
|
29
29
|
Card.styles = [
|
|
30
30
|
css `
|
|
31
|
+
* {
|
|
32
|
+
box-sizing: border-box;
|
|
33
|
+
}
|
|
31
34
|
:host {
|
|
32
35
|
--sc-card-padding: 1.5rem;
|
|
33
36
|
--sc-card-color: var(--sc-base-content);
|
|
@@ -38,15 +41,14 @@ Card.styles = [
|
|
|
38
41
|
}
|
|
39
42
|
|
|
40
43
|
@media print {
|
|
41
|
-
|
|
44
|
+
.card {
|
|
45
|
+
page-break-inside: avoid;
|
|
42
46
|
break-inside: avoid;
|
|
47
|
+
box-shadow: none !important;
|
|
48
|
+
border: 1px solid var(--sc-base-200);
|
|
43
49
|
}
|
|
44
50
|
}
|
|
45
51
|
|
|
46
|
-
* {
|
|
47
|
-
box-sizing: border-box;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
52
|
.card {
|
|
51
53
|
padding: var(--sc-card-padding);
|
|
52
54
|
background-color: var(--sc-card-bg);
|
|
@@ -35,9 +35,11 @@ declare const Checkbox_base: {
|
|
|
35
35
|
ariaLabel?: string | undefined;
|
|
36
36
|
_name: string;
|
|
37
37
|
name: string;
|
|
38
|
-
props:
|
|
39
|
-
propertyMap:
|
|
38
|
+
props: import("../../../../_types/types").CoreJSType;
|
|
39
|
+
propertyMap: object;
|
|
40
40
|
isConnected: boolean;
|
|
41
|
+
children: HTMLCollection;
|
|
42
|
+
appendChild(node: Node): Node;
|
|
41
43
|
getAncestorAttributeValue(attributeName: string): string;
|
|
42
44
|
hasAncestorAttribute(attributeName: string): boolean;
|
|
43
45
|
querySelectorAll(selector: string): NodeListOf<Element>;
|
|
@@ -56,14 +58,14 @@ declare const Checkbox_base: {
|
|
|
56
58
|
getApiConfiguration(): import("../../../../utils/api").APIConfiguration;
|
|
57
59
|
requestUpdate(): void;
|
|
58
60
|
getAttribute(name: string): string;
|
|
59
|
-
hasAttribute(attributeName:
|
|
61
|
+
hasAttribute(attributeName: string): boolean;
|
|
60
62
|
};
|
|
61
63
|
} & {
|
|
62
64
|
new (...args: any[]): {
|
|
63
65
|
validateFormElement(): void;
|
|
64
66
|
forceAutoFill: boolean;
|
|
65
|
-
_type: "number" | "search" | "file" | "button" | "
|
|
66
|
-
type: "number" | "search" | "file" | "button" | "
|
|
67
|
+
_type: "number" | "search" | "file" | "button" | "url" | "color" | "hidden" | "time" | "image" | "text" | "reset" | "submit" | "month" | "week" | "checkbox" | "radio" | "range" | "tel" | "email" | "date" | "datetime-local" | "password";
|
|
68
|
+
type: "number" | "search" | "file" | "button" | "url" | "color" | "hidden" | "time" | "image" | "text" | "reset" | "submit" | "month" | "week" | "checkbox" | "radio" | "range" | "tel" | "email" | "date" | "datetime-local" | "password";
|
|
67
69
|
_description?: string | undefined;
|
|
68
70
|
description: string | undefined;
|
|
69
71
|
_label?: string | undefined;
|
|
@@ -74,7 +76,27 @@ declare const Checkbox_base: {
|
|
|
74
76
|
updateDataValue(): void;
|
|
75
77
|
handleChange(e?: Event | undefined): void;
|
|
76
78
|
handleBlur(e?: Event | undefined): void;
|
|
77
|
-
|
|
79
|
+
/**
|
|
80
|
+
* ### Le composent sonic-checkbox étend les mixins FormCheckable, FormInput, FormElement et Subscriber
|
|
81
|
+
* **FormElement :**
|
|
82
|
+
* * La propriété value est remplie automatiquement a l'aide de l'attribut name renseigné, ceci en prenant la valeur de la propriété du même nom dans les données du dataprovider associé.
|
|
83
|
+
* * Par défault lorsque modifie l'input, la valeur est également mise à jour via le même dataprovider
|
|
84
|
+
* * On peut cependant décider de mettre à jour la donnée à une autre adresse en renseigne l'attribut *formDataProvider*.
|
|
85
|
+
* * Par conséquent on peut par exemple le lier à un composant *queue* (via sa propriété *dataFilterProvider*) de manière à appeller en auto une api avec des filtres.
|
|
86
|
+
* * **FormInput **
|
|
87
|
+
* Uniquement des propriétés classiques d'un input HTML. La prise en compte est ici partielle, par exemple les propriétés *placeholder*, *readonly*, *pattern*, *min* et *max* n'ont pas de sens pour un checkbox.
|
|
88
|
+
* **FormCheckable :**
|
|
89
|
+
* * La propriété checked mise à true si la valeur de la propriété du même nom dans les données du dataprovider associé contient un propriété checked.
|
|
90
|
+
* **Comportements :**
|
|
91
|
+
* * multiple (par défaut):
|
|
92
|
+
* - on peut cocher plusieurs checkbox ayant le même *name*.
|
|
93
|
+
* - la valeur enregistrée dans la propriété nommé du même nom dans formDataProvider est un tableau avec les *value* des cases cochées ayant le même *name*.
|
|
94
|
+
* * unique (Ajouter l'attribute unique au composant a l'intégration):
|
|
95
|
+
* - on ne peut cocher qu'une seule checkbox ayant le même *name*.
|
|
96
|
+
* * radio (Ajouter l'attribute radio au composant a l'intégration):
|
|
97
|
+
* Comme unique, mais on ne peut pas décocher la case sauf en en cochant une autre, comme un bouton radio.
|
|
98
|
+
*/
|
|
99
|
+
getValueForFormPublisher(): string | object | string[] | null | undefined;
|
|
78
100
|
focus?: (() => void) | undefined;
|
|
79
101
|
shadowRoot?: ShadowRoot | undefined;
|
|
80
102
|
error: boolean;
|
|
@@ -84,13 +106,15 @@ declare const Checkbox_base: {
|
|
|
84
106
|
formDataProvider: string;
|
|
85
107
|
ariaLabelledby?: string | undefined;
|
|
86
108
|
ariaLabel?: string | undefined;
|
|
87
|
-
_value: string | null;
|
|
88
|
-
value: string | null;
|
|
109
|
+
_value: string | object | string[] | null | undefined;
|
|
110
|
+
value: string | object | string[] | null | undefined;
|
|
89
111
|
_name: string;
|
|
90
112
|
name: string;
|
|
91
|
-
props:
|
|
92
|
-
propertyMap:
|
|
113
|
+
props: import("../../../../_types/types").CoreJSType;
|
|
114
|
+
propertyMap: object;
|
|
93
115
|
isConnected: boolean;
|
|
116
|
+
children: HTMLCollection;
|
|
117
|
+
appendChild(node: Node): Node;
|
|
94
118
|
getAncestorAttributeValue(attributeName: string): string;
|
|
95
119
|
hasAncestorAttribute(attributeName: string): boolean;
|
|
96
120
|
querySelectorAll(selector: string): NodeListOf<Element>;
|
|
@@ -110,10 +134,10 @@ declare const Checkbox_base: {
|
|
|
110
134
|
connectedCallback(): void;
|
|
111
135
|
requestUpdate(): void;
|
|
112
136
|
getAttribute(name: string): string;
|
|
113
|
-
hasAttribute(attributeName:
|
|
137
|
+
hasAttribute(attributeName: string): boolean;
|
|
114
138
|
disconnectedCallback(): void;
|
|
115
139
|
};
|
|
116
|
-
} & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/FormElement").FormElementInterface) & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<
|
|
140
|
+
} & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/FormElement").FormElementInterface) & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<import("../../../../_types/types").CoreJSType>) & typeof LitElement;
|
|
117
141
|
/**
|
|
118
142
|
* ### Le composent sonic-checkbox étend les mixins FormCheckable, FormInput, FormElement et Subscriber
|
|
119
143
|
* **FormElement :**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import "./legend";
|
|
3
|
-
declare const Fieldset_base: (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<
|
|
3
|
+
declare const Fieldset_base: (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<import("../../../../_types/types").CoreJSType>) & typeof LitElement;
|
|
4
4
|
export declare class Fieldset extends Fieldset_base {
|
|
5
5
|
static styles: import("lit").CSSResult[];
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import { ResizeController } from "@lit-labs/observers/resize_controller.js";
|
|
3
|
-
declare const FormLayout_base: (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<
|
|
3
|
+
declare const FormLayout_base: (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<import("../../../../_types/types").CoreJSType>) & typeof LitElement;
|
|
4
4
|
export declare class FormLayout extends FormLayout_base {
|
|
5
5
|
static styles: import("lit").CSSResult[];
|
|
6
6
|
_resizeController: ResizeController<unknown>;
|
|
@@ -3,8 +3,8 @@ declare const Input_base: {
|
|
|
3
3
|
new (...args: any[]): {
|
|
4
4
|
validateFormElement(): void;
|
|
5
5
|
forceAutoFill: boolean;
|
|
6
|
-
_type: "number" | "search" | "file" | "button" | "
|
|
7
|
-
type: "number" | "search" | "file" | "button" | "
|
|
6
|
+
_type: "number" | "search" | "file" | "button" | "url" | "color" | "hidden" | "time" | "image" | "text" | "reset" | "submit" | "month" | "week" | "checkbox" | "radio" | "range" | "tel" | "email" | "date" | "datetime-local" | "password";
|
|
7
|
+
type: "number" | "search" | "file" | "button" | "url" | "color" | "hidden" | "time" | "image" | "text" | "reset" | "submit" | "month" | "week" | "checkbox" | "radio" | "range" | "tel" | "email" | "date" | "datetime-local" | "password";
|
|
8
8
|
_description?: string | undefined;
|
|
9
9
|
description: string | undefined;
|
|
10
10
|
_label?: string | undefined;
|
|
@@ -15,7 +15,7 @@ declare const Input_base: {
|
|
|
15
15
|
updateDataValue(): void;
|
|
16
16
|
handleChange(e?: Event | undefined): void;
|
|
17
17
|
handleBlur(e?: Event | undefined): void;
|
|
18
|
-
getValueForFormPublisher():
|
|
18
|
+
getValueForFormPublisher(): string | object | string[] | null | undefined;
|
|
19
19
|
focus?: (() => void) | undefined;
|
|
20
20
|
shadowRoot?: ShadowRoot | undefined;
|
|
21
21
|
error: boolean;
|
|
@@ -25,13 +25,15 @@ declare const Input_base: {
|
|
|
25
25
|
formDataProvider: string;
|
|
26
26
|
ariaLabelledby?: string | undefined;
|
|
27
27
|
ariaLabel?: string | undefined;
|
|
28
|
-
_value: string | null;
|
|
29
|
-
value: string | null;
|
|
28
|
+
_value: string | object | string[] | null | undefined;
|
|
29
|
+
value: string | object | string[] | null | undefined;
|
|
30
30
|
_name: string;
|
|
31
31
|
name: string;
|
|
32
|
-
props:
|
|
33
|
-
propertyMap:
|
|
32
|
+
props: import("../../../../_types/types").CoreJSType;
|
|
33
|
+
propertyMap: object;
|
|
34
34
|
isConnected: boolean;
|
|
35
|
+
children: HTMLCollection;
|
|
36
|
+
appendChild(node: Node): Node;
|
|
35
37
|
getAncestorAttributeValue(attributeName: string): string;
|
|
36
38
|
hasAncestorAttribute(attributeName: string): boolean;
|
|
37
39
|
querySelectorAll(selector: string): NodeListOf<Element>;
|
|
@@ -48,13 +50,16 @@ declare const Input_base: {
|
|
|
48
50
|
removeAttribute(name: string): void;
|
|
49
51
|
initPublisher(): void;
|
|
50
52
|
getApiConfiguration(): import("../../../../utils/api").APIConfiguration;
|
|
53
|
+
/**
|
|
54
|
+
* Taille du composant, implique notamment des modifications de typo et de marge interne
|
|
55
|
+
*/
|
|
51
56
|
connectedCallback(): void;
|
|
52
57
|
requestUpdate(): void;
|
|
53
58
|
getAttribute(name: string): string;
|
|
54
|
-
hasAttribute(attributeName:
|
|
59
|
+
hasAttribute(attributeName: string): boolean;
|
|
55
60
|
disconnectedCallback(): void;
|
|
56
61
|
};
|
|
57
|
-
} & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/FormElement").FormElementInterface) & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<
|
|
62
|
+
} & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/FormElement").FormElementInterface) & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<import("../../../../_types/types").CoreJSType>) & typeof LitElement;
|
|
58
63
|
export declare class Input extends Input_base {
|
|
59
64
|
static styles: import("lit").CSSResult[];
|
|
60
65
|
/**
|
|
@@ -43,7 +43,7 @@ let Input = class Input extends FormInput(FormElement(Subscriber(LitElement))) {
|
|
|
43
43
|
if (this.hasAttribute("sameValueAs")) {
|
|
44
44
|
this.sameValueAsName = this.getAttribute("sameValueAs");
|
|
45
45
|
this.sameValueAsHandle = (v) => (this.pattern = v);
|
|
46
|
-
|
|
46
|
+
const formPublisher = this.getFormPublisher();
|
|
47
47
|
if (!formPublisher)
|
|
48
48
|
return;
|
|
49
49
|
formPublisher[this.sameValueAsName].onAssign(this.sameValueAsHandle);
|
|
@@ -52,7 +52,7 @@ let Input = class Input extends FormInput(FormElement(Subscriber(LitElement))) {
|
|
|
52
52
|
disconnectedCallback() {
|
|
53
53
|
super.disconnectedCallback();
|
|
54
54
|
if (this.hasAttribute("sameValueAs") && this.sameValueAsName) {
|
|
55
|
-
|
|
55
|
+
const formPublisher = this.getFormPublisher();
|
|
56
56
|
if (!formPublisher)
|
|
57
57
|
return;
|
|
58
58
|
formPublisher[this.sameValueAsName].offAssign(this.sameValueAsHandle);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LitElement, nothing } from "lit";
|
|
2
2
|
import "@supersoniks/concorde/core/components/ui/icon/icon";
|
|
3
|
-
declare const SonicComponent_base: (new (...args: any[]) => import("../../../../mixins/Subscriber").SubscriberInterface<
|
|
3
|
+
declare const SonicComponent_base: (new (...args: any[]) => import("../../../../mixins/Subscriber").SubscriberInterface<import("../../../../_types/types").CoreJSType>) & typeof LitElement;
|
|
4
4
|
export declare class SonicComponent extends SonicComponent_base {
|
|
5
5
|
name?: string;
|
|
6
6
|
minChars: number;
|
|
@@ -42,7 +42,7 @@ let SonicComponent = class SonicComponent extends Subscriber(LitElement) {
|
|
|
42
42
|
this.hasMinuscule = /[a-z]/.test(v);
|
|
43
43
|
this.hasMajuscule = /[A-Z]/.test(v);
|
|
44
44
|
this.hasNumber = /[0-9]/.test(v);
|
|
45
|
-
this.hasSpecialChar = /[!"#$%&'()
|
|
45
|
+
this.hasSpecialChar = /[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~]/.test(v);
|
|
46
46
|
};
|
|
47
47
|
PublisherManager.get(this.getAncestorAttributeValue("formDataProvider"))[this.name].onAssign(this.checkValue);
|
|
48
48
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LitElement, nothing } from "lit";
|
|
2
2
|
import "@supersoniks/concorde/core/components/ui/icon/icon";
|
|
3
|
-
declare const SonicComponent_base: (new (...args: any[]) => import("../../../../mixins/Subscriber").SubscriberInterface<
|
|
3
|
+
declare const SonicComponent_base: (new (...args: any[]) => import("../../../../mixins/Subscriber").SubscriberInterface<import("../../../../_types/types").CoreJSType>) & typeof LitElement;
|
|
4
4
|
export declare class SonicComponent extends SonicComponent_base {
|
|
5
5
|
name?: string;
|
|
6
6
|
sameValueAs?: string;
|
|
@@ -21,7 +21,7 @@ let SonicComponent = class SonicComponent extends Subscriber(LitElement) {
|
|
|
21
21
|
}
|
|
22
22
|
connectedCallback() {
|
|
23
23
|
super.connectedCallback();
|
|
24
|
-
|
|
24
|
+
const formDataProvider = PublisherManager.get(this.getAncestorAttributeValue("formDataProvider"));
|
|
25
25
|
if (this.name && this.sameValueAs) {
|
|
26
26
|
this.checkValue = (v) => {
|
|
27
27
|
if (v)
|
|
@@ -38,7 +38,7 @@ let SonicComponent = class SonicComponent extends Subscriber(LitElement) {
|
|
|
38
38
|
}
|
|
39
39
|
disconnectedCallback() {
|
|
40
40
|
if (this.checkValue && this.name && this.sameValueAs) {
|
|
41
|
-
|
|
41
|
+
const formDataProvider = PublisherManager.get(this.getAncestorAttributeValue("formDataProvider"));
|
|
42
42
|
formDataProvider[this.name].offAssign(this.checkValue);
|
|
43
43
|
formDataProvider[this.sameValueAs].offAssign(this.checkValue);
|
|
44
44
|
}
|
|
@@ -3,7 +3,7 @@ import "@supersoniks/concorde/core/components/ui/form/input/input";
|
|
|
3
3
|
import "@supersoniks/concorde/core/components/ui/pop/pop";
|
|
4
4
|
import "@supersoniks/concorde/core/components/functional/queue/queue";
|
|
5
5
|
import "@supersoniks/concorde/core/components/ui/menu/menu-item";
|
|
6
|
-
declare const InputAutocomplete_base: (new (...args: any[]) => import("../../../../mixins/TemplatesContainer").TemplatesContainerInterface) & (new (...args: any[]) => import("../../../../mixins/Subscriber").SubscriberInterface<
|
|
6
|
+
declare const InputAutocomplete_base: (new (...args: any[]) => import("../../../../mixins/TemplatesContainer").TemplatesContainerInterface) & (new (...args: any[]) => import("../../../../mixins/Subscriber").SubscriberInterface<import("../../../../_types/types").CoreJSType>) & typeof LitElement;
|
|
7
7
|
/**
|
|
8
8
|
* Input avec autocomplete. Propose des valeurs à partir d'un sonic-queue.
|
|
9
9
|
* L'input permet de filtrer les choix de valeurs dans le sonic-pop.
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { LitElement, PropertyValues } from "lit";
|
|
2
2
|
import "@supersoniks/concorde/core/components/ui/icon/icon";
|
|
3
|
-
|
|
3
|
+
import { Size } from "@supersoniks/concorde/core/components/ui/_css/size";
|
|
4
|
+
export type SelectOption = {
|
|
4
5
|
value?: string;
|
|
5
6
|
wording?: string;
|
|
6
7
|
selected?: boolean;
|
|
7
8
|
hasAttribute?: (value: string) => boolean;
|
|
8
9
|
} & Record<string, string>;
|
|
9
|
-
declare const Select_base: (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/FormElement").FormElementInterface) & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<
|
|
10
|
+
declare const Select_base: (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/FormElement").FormElementInterface) & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<import("../../../../_types/types").CoreJSType>) & typeof LitElement;
|
|
10
11
|
/**
|
|
11
12
|
* #### FormElement :
|
|
12
13
|
* * La propriété value est remplie automatiquement a l'aide de l'attribut name renseigné, ceci en prenant la valeur de la propriété du même nom dans les données du dataprovider associé.
|
|
@@ -19,13 +20,13 @@ export declare class Select extends Select_base {
|
|
|
19
20
|
valueKey: string;
|
|
20
21
|
wordingKey: string;
|
|
21
22
|
multiple: boolean;
|
|
22
|
-
size?:
|
|
23
|
+
size?: Size;
|
|
23
24
|
selectSize?: number;
|
|
24
25
|
private _options;
|
|
25
26
|
set options(options: Array<SelectOption>);
|
|
26
27
|
get options(): Array<SelectOption>;
|
|
27
28
|
hasDoneFirstUpdate: boolean;
|
|
28
|
-
protected firstUpdated(
|
|
29
|
+
protected firstUpdated(): void;
|
|
29
30
|
_value: string;
|
|
30
31
|
set value(value: string);
|
|
31
32
|
get value(): string;
|
|
@@ -49,7 +49,7 @@ let Select = class Select extends FormElement(Subscriber(LitElement)) {
|
|
|
49
49
|
this.value = option.value || "";
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
|
|
52
|
+
const value = this.value || this.getAttribute("value");
|
|
53
53
|
if (!value && this._options.length > 0) {
|
|
54
54
|
this.value = this._options[0][this.valueKey];
|
|
55
55
|
}
|
|
@@ -58,7 +58,7 @@ let Select = class Select extends FormElement(Subscriber(LitElement)) {
|
|
|
58
58
|
get options() {
|
|
59
59
|
return this._options;
|
|
60
60
|
}
|
|
61
|
-
firstUpdated(
|
|
61
|
+
firstUpdated() {
|
|
62
62
|
this.hasDoneFirstUpdate = true;
|
|
63
63
|
}
|
|
64
64
|
set value(value) {
|
|
@@ -76,7 +76,7 @@ let Select = class Select extends FormElement(Subscriber(LitElement)) {
|
|
|
76
76
|
return this._value;
|
|
77
77
|
}
|
|
78
78
|
updateFormPublisherValue() {
|
|
79
|
-
|
|
79
|
+
const formPublisher = this.getFormPublisher();
|
|
80
80
|
if (formPublisher) {
|
|
81
81
|
formPublisher[this.name] = this.value;
|
|
82
82
|
}
|
|
@@ -84,7 +84,7 @@ let Select = class Select extends FormElement(Subscriber(LitElement)) {
|
|
|
84
84
|
connectedCallback() {
|
|
85
85
|
super.connectedCallback();
|
|
86
86
|
this.hasSlotOrProps();
|
|
87
|
-
|
|
87
|
+
const options = this.querySelectorAll("option");
|
|
88
88
|
if (options.length > 0) {
|
|
89
89
|
this.options = Array.from(options).map((option) => {
|
|
90
90
|
return {
|
|
@@ -129,7 +129,7 @@ let Select = class Select extends FormElement(Subscriber(LitElement)) {
|
|
|
129
129
|
const select = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector("select");
|
|
130
130
|
if (!select || select.checkValidity())
|
|
131
131
|
return;
|
|
132
|
-
|
|
132
|
+
const formPublisher = this.getFormPublisher();
|
|
133
133
|
if (formPublisher) {
|
|
134
134
|
formPublisher.isFormValid = false;
|
|
135
135
|
}
|
|
@@ -156,7 +156,7 @@ let Select = class Select extends FormElement(Subscriber(LitElement)) {
|
|
|
156
156
|
id="form-element"
|
|
157
157
|
@change=${this.handleChange}
|
|
158
158
|
@blur=${this.handleBlur}
|
|
159
|
-
?disabled=${
|
|
159
|
+
?disabled=${this.disabled}
|
|
160
160
|
?required=${this.required}
|
|
161
161
|
?multiple=${this.multiple}
|
|
162
162
|
size=${ifDefined(this.selectSize)}
|
|
@@ -167,8 +167,8 @@ let Select = class Select extends FormElement(Subscriber(LitElement)) {
|
|
|
167
167
|
aria-labelledby=${ifDefined(this.ariaLabelledby)}
|
|
168
168
|
>
|
|
169
169
|
${repeat(this.options, (option) => option[this.valueKey], (option) => {
|
|
170
|
-
const isSelected = this.value == option[this.valueKey] ?
|
|
171
|
-
return html `<option selected=${
|
|
170
|
+
const isSelected = this.value == option[this.valueKey] ? true : false;
|
|
171
|
+
return html `<option ?selected=${isSelected} value="${option[this.valueKey]}">
|
|
172
172
|
${option[this.wordingKey]}
|
|
173
173
|
</option>`;
|
|
174
174
|
})}
|