@supersoniks/concorde 1.1.40 → 1.1.41
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/components.d.ts +0 -0
- package/components.js +0 -0
- package/concorde-core.bundle.js +28 -21
- package/concorde-core.es.js +849 -448
- package/core/components/functional/configuration/configuration.d.ts +0 -0
- package/core/components/functional/configuration/configuration.js +0 -0
- package/core/components/functional/date/date.d.ts +0 -0
- package/core/components/functional/date/date.js +0 -0
- package/core/components/functional/example/example.d.ts +0 -0
- package/core/components/functional/example/example.js +0 -0
- package/core/components/functional/fetch/fetch.d.ts +0 -0
- package/core/components/functional/fetch/fetch.js +0 -0
- package/core/components/functional/functional.d.ts +0 -0
- package/core/components/functional/functional.js +0 -0
- package/core/components/functional/if/if.d.ts +0 -0
- package/core/components/functional/if/if.js +0 -0
- package/core/components/functional/list/list.d.ts +0 -0
- package/core/components/functional/list/list.js +0 -0
- package/core/components/functional/queue/queue.d.ts +0 -0
- package/core/components/functional/queue/queue.js +0 -0
- package/core/components/functional/router/redirect.d.ts +0 -0
- package/core/components/functional/router/redirect.js +0 -0
- package/core/components/functional/router/router.d.ts +0 -0
- package/core/components/functional/router/router.js +0 -0
- package/core/components/functional/sdui/SDUIDescriptorTransformer.d.ts +59 -0
- package/core/components/functional/sdui/SDUIDescriptorTransformer.js +219 -0
- package/core/components/functional/sdui/sdui.d.ts +77 -21
- package/core/components/functional/sdui/sdui.js +177 -78
- package/core/components/functional/sdui/types.d.ts +35 -0
- package/core/components/functional/sdui/types.js +1 -0
- package/core/components/functional/sonic-scope/sonic-scope.d.ts +0 -0
- package/core/components/functional/sonic-scope/sonic-scope.js +0 -0
- package/core/components/functional/states/states.d.ts +0 -0
- package/core/components/functional/states/states.js +0 -0
- package/core/components/functional/submit/submit.d.ts +0 -0
- package/core/components/functional/submit/submit.js +0 -0
- package/core/components/functional/subscriber/subscriber.d.ts +0 -0
- package/core/components/functional/subscriber/subscriber.js +0 -0
- package/core/components/ui/_css/scroll.d.ts +0 -0
- package/core/components/ui/_css/scroll.js +0 -0
- package/core/components/ui/_css/size.d.ts +0 -0
- package/core/components/ui/_css/size.js +0 -0
- package/core/components/ui/_css/type.d.ts +0 -0
- package/core/components/ui/_css/type.js +0 -0
- package/core/components/ui/alert/alert.d.ts +2 -2
- package/core/components/ui/alert/alert.js +12 -11
- package/core/components/ui/badge/badge.d.ts +0 -0
- package/core/components/ui/badge/badge.js +0 -0
- package/core/components/ui/button/button.d.ts +0 -0
- package/core/components/ui/button/button.js +0 -0
- package/core/components/ui/captcha/captcha.d.ts +0 -0
- package/core/components/ui/captcha/captcha.js +0 -0
- package/core/components/ui/card/card-footer.d.ts +0 -0
- package/core/components/ui/card/card-footer.js +0 -0
- package/core/components/ui/card/card-header-descripton.d.ts +0 -0
- package/core/components/ui/card/card-header-descripton.js +0 -0
- package/core/components/ui/card/card-header.d.ts +0 -0
- package/core/components/ui/card/card-header.js +0 -0
- package/core/components/ui/card/card-main.d.ts +0 -0
- package/core/components/ui/card/card-main.js +0 -0
- package/core/components/ui/card/card.d.ts +0 -0
- package/core/components/ui/card/card.js +0 -0
- package/core/components/ui/divider/divider.d.ts +0 -0
- package/core/components/ui/divider/divider.js +0 -0
- package/core/components/ui/form/checkbox/checkbox.d.ts +0 -0
- package/core/components/ui/form/checkbox/checkbox.js +2 -1
- package/core/components/ui/form/css/form-control.d.ts +0 -0
- package/core/components/ui/form/css/form-control.js +0 -0
- package/core/components/ui/form/fieldset/fieldset.d.ts +0 -0
- package/core/components/ui/form/fieldset/fieldset.js +0 -0
- package/core/components/ui/form/fieldset/legend-description.d.ts +0 -0
- package/core/components/ui/form/fieldset/legend-description.js +0 -0
- package/core/components/ui/form/fieldset/legend.d.ts +0 -0
- package/core/components/ui/form/fieldset/legend.js +0 -0
- package/core/components/ui/form/form-actions/form-actions.d.ts +0 -0
- package/core/components/ui/form/form-actions/form-actions.js +0 -0
- package/core/components/ui/form/form-layout/form-layout.d.ts +0 -0
- package/core/components/ui/form/form-layout/form-layout.js +0 -0
- package/core/components/ui/form/input/input.d.ts +4 -0
- package/core/components/ui/form/input/input.js +20 -3
- package/core/components/ui/form/input/password-helper.d.ts +19 -0
- package/core/components/ui/form/input/password-helper.js +96 -0
- package/core/components/ui/form/input/same-value-helper.d.ts +16 -0
- package/core/components/ui/form/input/same-value-helper.js +76 -0
- package/core/components/ui/form/radio/radio.d.ts +0 -0
- package/core/components/ui/form/radio/radio.js +0 -0
- package/core/components/ui/form/select/select.d.ts +0 -0
- package/core/components/ui/form/select/select.js +5 -1
- package/core/components/ui/form/textarea/textarea.d.ts +0 -0
- package/core/components/ui/form/textarea/textarea.js +5 -1
- package/core/components/ui/group/group.d.ts +0 -0
- package/core/components/ui/group/group.js +0 -0
- package/core/components/ui/icon/icon.d.ts +0 -0
- package/core/components/ui/icon/icon.js +0 -0
- package/core/components/ui/icon/icons.d.ts +0 -0
- package/core/components/ui/icon/icons.js +0 -0
- package/core/components/ui/icon/icons.json +0 -0
- package/core/components/ui/image/image.d.ts +0 -0
- package/core/components/ui/image/image.js +0 -0
- package/core/components/ui/link/link.d.ts +0 -0
- package/core/components/ui/link/link.js +0 -0
- package/core/components/ui/loader/loader.d.ts +0 -0
- package/core/components/ui/loader/loader.js +0 -0
- package/core/components/ui/loader/styles/fixed.d.ts +0 -0
- package/core/components/ui/loader/styles/fixed.js +0 -0
- package/core/components/ui/loader/styles/inline.d.ts +0 -0
- package/core/components/ui/loader/styles/inline.js +0 -0
- package/core/components/ui/menu/menu-item.d.ts +0 -0
- package/core/components/ui/menu/menu-item.js +0 -0
- package/core/components/ui/menu/menu.d.ts +0 -0
- package/core/components/ui/menu/menu.js +0 -0
- package/core/components/ui/modal/modal-actions.d.ts +0 -0
- package/core/components/ui/modal/modal-actions.js +0 -0
- package/core/components/ui/modal/modal-close.d.ts +0 -0
- package/core/components/ui/modal/modal-close.js +0 -0
- package/core/components/ui/modal/modal-content.d.ts +0 -0
- package/core/components/ui/modal/modal-content.js +0 -0
- package/core/components/ui/modal/modal-subtitle.d.ts +0 -0
- package/core/components/ui/modal/modal-subtitle.js +0 -0
- package/core/components/ui/modal/modal-title.d.ts +0 -0
- package/core/components/ui/modal/modal-title.js +0 -0
- package/core/components/ui/modal/modal.d.ts +0 -0
- package/core/components/ui/modal/modal.js +0 -0
- package/core/components/ui/pop/pop.d.ts +0 -0
- package/core/components/ui/pop/pop.js +0 -0
- package/core/components/ui/progress/progress.d.ts +0 -0
- package/core/components/ui/progress/progress.js +0 -0
- package/core/components/ui/table/table-caption.d.ts +0 -0
- package/core/components/ui/table/table-caption.js +0 -0
- package/core/components/ui/table/table-tbody.d.ts +0 -0
- package/core/components/ui/table/table-tbody.js +0 -0
- package/core/components/ui/table/table-td.d.ts +0 -0
- package/core/components/ui/table/table-td.js +0 -0
- package/core/components/ui/table/table-tfoot.d.ts +0 -0
- package/core/components/ui/table/table-tfoot.js +0 -0
- package/core/components/ui/table/table-th.d.ts +0 -0
- package/core/components/ui/table/table-th.js +0 -0
- package/core/components/ui/table/table-thead.d.ts +0 -0
- package/core/components/ui/table/table-thead.js +0 -0
- package/core/components/ui/table/table-tr.d.ts +0 -0
- package/core/components/ui/table/table-tr.js +0 -0
- package/core/components/ui/table/table.d.ts +0 -0
- package/core/components/ui/table/table.js +0 -0
- package/core/components/ui/tabs/tab.d.ts +0 -0
- package/core/components/ui/tabs/tab.js +0 -0
- package/core/components/ui/tabs/tabs.d.ts +0 -0
- package/core/components/ui/tabs/tabs.js +0 -0
- package/core/components/ui/taxonomy/taxonomy.d.ts +0 -0
- package/core/components/ui/taxonomy/taxonomy.js +0 -0
- 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.d.ts +0 -0
- package/core/components/ui/theme/theme-collection/core-variables.js +0 -0
- package/core/components/ui/theme/theme-collection/dark.d.ts +0 -0
- package/core/components/ui/theme/theme-collection/dark.js +0 -0
- package/core/components/ui/theme/theme-collection/light.d.ts +0 -0
- package/core/components/ui/theme/theme-collection/light.js +0 -0
- package/core/components/ui/theme/theme.d.ts +0 -0
- package/core/components/ui/theme/theme.js +0 -0
- package/core/components/ui/toast/message-subscriber.d.ts +0 -0
- package/core/components/ui/toast/message-subscriber.js +0 -0
- package/core/components/ui/toast/toast-item.d.ts +0 -0
- package/core/components/ui/toast/toast-item.js +0 -0
- package/core/components/ui/toast/toast.d.ts +0 -0
- package/core/components/ui/toast/toast.js +0 -0
- package/core/components/ui/toast/types.d.ts +0 -0
- package/core/components/ui/toast/types.js +0 -0
- package/core/components/ui/tooltip/tooltip.d.ts +0 -0
- package/core/components/ui/tooltip/tooltip.js +0 -0
- package/core/components/ui/ui.d.ts +2 -0
- package/core/components/ui/ui.js +2 -0
- package/core/core.d.ts +0 -0
- package/core/core.js +0 -0
- package/core/mixins/Fetcher.d.ts +0 -0
- package/core/mixins/Fetcher.js +6 -2
- package/core/mixins/FormCheckable.d.ts +0 -0
- package/core/mixins/FormCheckable.js +0 -0
- package/core/mixins/FormElement.d.ts +0 -0
- package/core/mixins/FormElement.js +0 -0
- package/core/mixins/FormInput.d.ts +0 -0
- package/core/mixins/FormInput.js +0 -0
- package/core/mixins/Subscriber.d.ts +0 -0
- package/core/mixins/Subscriber.js +0 -0
- package/core/mixins/TemplatesContainer.d.ts +0 -0
- package/core/mixins/TemplatesContainer.js +0 -0
- package/core/mixins/mixins.d.ts +0 -0
- package/core/mixins/mixins.js +0 -0
- package/core/utils/Arrays.d.ts +0 -0
- package/core/utils/Arrays.js +0 -0
- package/core/utils/DataBindObserver.d.ts +0 -0
- package/core/utils/DataBindObserver.js +0 -0
- package/core/utils/Electron.d.ts +0 -0
- package/core/utils/Electron.js +0 -0
- package/core/utils/Format.d.ts +0 -0
- package/core/utils/Format.js +0 -0
- package/core/utils/HTML.d.ts +8 -0
- package/core/utils/HTML.js +41 -0
- package/core/utils/LocationHandler.d.ts +0 -0
- package/core/utils/LocationHandler.js +0 -0
- package/core/utils/Objects.d.ts +0 -0
- package/core/utils/Objects.js +0 -0
- package/core/utils/PublisherProxy.d.mts +0 -0
- package/core/utils/PublisherProxy.mjs +0 -0
- package/core/utils/api.d.ts +0 -0
- package/core/utils/api.js +0 -0
- package/mixins.d.ts +0 -0
- package/mixins.js +0 -0
- package/package.json +9 -1
- package/utils.d.ts +0 -0
- package/utils.js +0 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { html, LitElement, nothing } from "lit";
|
|
8
|
+
import { customElement, property, state } from "lit/decorators.js";
|
|
9
|
+
import { Subscriber } from "@supersoniks/concorde/mixins";
|
|
10
|
+
import { PublisherManager } from "@supersoniks/concorde/utils";
|
|
11
|
+
import "@supersoniks/concorde/core/components/ui/icon/icon";
|
|
12
|
+
const tagName = "sonic-password-helper"; // For Astro.build
|
|
13
|
+
console.log("HEY");
|
|
14
|
+
let SonicComponent = class SonicComponent extends Subscriber(LitElement) {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
this.minChars = 8;
|
|
18
|
+
this.hasNoChar = true;
|
|
19
|
+
this.hasEnoughChars = false;
|
|
20
|
+
this.hasMinuscule = false;
|
|
21
|
+
this.hasMajuscule = false;
|
|
22
|
+
this.hasNumber = false;
|
|
23
|
+
this.hasSpecialChar = false;
|
|
24
|
+
}
|
|
25
|
+
connectedCallback() {
|
|
26
|
+
super.connectedCallback();
|
|
27
|
+
if (this.name) {
|
|
28
|
+
this.checkValue = (v) => {
|
|
29
|
+
if (v) {
|
|
30
|
+
this.hasNoChar = v.length == 0;
|
|
31
|
+
this.hasEnoughChars = v.length > this.minChars;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
this.hasNoChar = true;
|
|
35
|
+
this.hasEnoughChars = false;
|
|
36
|
+
}
|
|
37
|
+
this.hasMinuscule = /[a-z]/.test(v);
|
|
38
|
+
this.hasMajuscule = /[A-Z]/.test(v);
|
|
39
|
+
this.hasNumber = /[0-9]/.test(v);
|
|
40
|
+
this.hasSpecialChar = /[!"#$%&'()*+,\-\.\/:;<=>?@[\]^_`{|}~]/.test(v);
|
|
41
|
+
};
|
|
42
|
+
PublisherManager.get(this.getAncestorAttributeValue("formDataProvider"))[this.name].onAssign(this.checkValue);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
disconnectedCallback() {
|
|
46
|
+
if (this.checkValue && this.name) {
|
|
47
|
+
PublisherManager.get(this.getAncestorAttributeValue("formDataProvider"))[this.name].offAssign(this.checkValue);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
getIcon(test) {
|
|
51
|
+
return test
|
|
52
|
+
? html `<sonic-icon library="heroicons" , name="face-smile"></sonic-icon>`
|
|
53
|
+
: html `<sonic-icon library="heroicons" , name="x-circle"></sonic-icon>`;
|
|
54
|
+
}
|
|
55
|
+
//TODO Multilangue
|
|
56
|
+
render() {
|
|
57
|
+
if (this.hasNoChar)
|
|
58
|
+
return nothing;
|
|
59
|
+
return html `
|
|
60
|
+
<div>Le mot de passe doit contenir au moins :</div>
|
|
61
|
+
<div>${this.getIcon(this.hasEnoughChars)} 8 caractères</div>
|
|
62
|
+
<div>${this.getIcon(this.hasMinuscule)} 1 minuscule</div>
|
|
63
|
+
<div>${this.getIcon(this.hasMajuscule)} 1 majuscule</div>
|
|
64
|
+
<div>${this.getIcon(this.hasNumber)} 1 chiffre</div>
|
|
65
|
+
<div>${this.getIcon(this.hasSpecialChar)} 1 caractère spécial parmi !"#$%&'()*+,-./:;<=>?@[]^_\`{|}~</div>
|
|
66
|
+
`;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
__decorate([
|
|
70
|
+
property()
|
|
71
|
+
], SonicComponent.prototype, "name", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
property()
|
|
74
|
+
], SonicComponent.prototype, "minChars", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
state()
|
|
77
|
+
], SonicComponent.prototype, "hasNoChar", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
state()
|
|
80
|
+
], SonicComponent.prototype, "hasEnoughChars", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
state()
|
|
83
|
+
], SonicComponent.prototype, "hasMinuscule", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
state()
|
|
86
|
+
], SonicComponent.prototype, "hasMajuscule", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
state()
|
|
89
|
+
], SonicComponent.prototype, "hasNumber", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
state()
|
|
92
|
+
], SonicComponent.prototype, "hasSpecialChar", void 0);
|
|
93
|
+
SonicComponent = __decorate([
|
|
94
|
+
customElement(tagName)
|
|
95
|
+
], SonicComponent);
|
|
96
|
+
export { SonicComponent };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LitElement, nothing } from "lit";
|
|
2
|
+
import "@supersoniks/concorde/core/components/ui/icon/icon";
|
|
3
|
+
declare const SonicComponent_base: (new (...args: any[]) => import("../../../../mixins/Subscriber").SubscriberInterface) & typeof LitElement;
|
|
4
|
+
export declare class SonicComponent extends SonicComponent_base {
|
|
5
|
+
name?: string;
|
|
6
|
+
sameValueAs?: string;
|
|
7
|
+
descriptionWhenEqual: string;
|
|
8
|
+
descriptionWhenNotEqual: string;
|
|
9
|
+
areEqual: boolean;
|
|
10
|
+
hasNoChar: boolean;
|
|
11
|
+
checkValue?: (v: string) => void;
|
|
12
|
+
connectedCallback(): void;
|
|
13
|
+
disconnectedCallback(): void;
|
|
14
|
+
render(): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { html, LitElement, nothing } from "lit";
|
|
8
|
+
import { customElement, property, state } from "lit/decorators.js";
|
|
9
|
+
import { Subscriber } from "@supersoniks/concorde/mixins";
|
|
10
|
+
import { PublisherManager } from "@supersoniks/concorde/utils";
|
|
11
|
+
import "@supersoniks/concorde/core/components/ui/icon/icon";
|
|
12
|
+
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
13
|
+
const tagName = "sonic-same-value-helper"; // For Astro.build
|
|
14
|
+
let SonicComponent = class SonicComponent extends Subscriber(LitElement) {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
this.descriptionWhenEqual = "Correspondance : oui";
|
|
18
|
+
this.descriptionWhenNotEqual = "Correspondance : non";
|
|
19
|
+
this.areEqual = false;
|
|
20
|
+
this.hasNoChar = true;
|
|
21
|
+
}
|
|
22
|
+
connectedCallback() {
|
|
23
|
+
super.connectedCallback();
|
|
24
|
+
let formDataProvider = PublisherManager.get(this.getAncestorAttributeValue("formDataProvider"));
|
|
25
|
+
if (this.name && this.sameValueAs) {
|
|
26
|
+
this.checkValue = (v) => {
|
|
27
|
+
if (v)
|
|
28
|
+
this.hasNoChar = v.length == 0;
|
|
29
|
+
else
|
|
30
|
+
this.hasNoChar = true;
|
|
31
|
+
if (this.name && this.sameValueAs) {
|
|
32
|
+
this.areEqual = formDataProvider[this.name].get() == formDataProvider[this.sameValueAs].get();
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
formDataProvider[this.name].onAssign(this.checkValue);
|
|
36
|
+
formDataProvider[this.sameValueAs].onAssign(this.checkValue);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
disconnectedCallback() {
|
|
40
|
+
if (this.checkValue && this.name && this.sameValueAs) {
|
|
41
|
+
let formDataProvider = PublisherManager.get(this.getAncestorAttributeValue("formDataProvider"));
|
|
42
|
+
formDataProvider[this.name].offAssign(this.checkValue);
|
|
43
|
+
formDataProvider[this.sameValueAs].offAssign(this.checkValue);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
//TODO Multilangue
|
|
47
|
+
render() {
|
|
48
|
+
if (this.hasNoChar)
|
|
49
|
+
return nothing;
|
|
50
|
+
return html `
|
|
51
|
+
<span> ${this.areEqual ? unsafeHTML(this.descriptionWhenEqual) : unsafeHTML(this.descriptionWhenNotEqual)} </span>
|
|
52
|
+
`;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
__decorate([
|
|
56
|
+
property()
|
|
57
|
+
], SonicComponent.prototype, "name", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
property()
|
|
60
|
+
], SonicComponent.prototype, "sameValueAs", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
property()
|
|
63
|
+
], SonicComponent.prototype, "descriptionWhenEqual", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
property()
|
|
66
|
+
], SonicComponent.prototype, "descriptionWhenNotEqual", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
state()
|
|
69
|
+
], SonicComponent.prototype, "areEqual", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
state()
|
|
72
|
+
], SonicComponent.prototype, "hasNoChar", void 0);
|
|
73
|
+
SonicComponent = __decorate([
|
|
74
|
+
customElement(tagName)
|
|
75
|
+
], SonicComponent);
|
|
76
|
+
export { SonicComponent };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -123,9 +123,13 @@ let Select = class Select extends FormElement(Subscriber(LitElement)) {
|
|
|
123
123
|
"has-prefix": this.hasPrefix,
|
|
124
124
|
"has-suffix": this.hasSuffix,
|
|
125
125
|
};
|
|
126
|
+
let labelStarSuffix = this.label && this.required && this.label.indexOf("*") == -1 ? " *" : "";
|
|
126
127
|
return html `
|
|
127
128
|
<label for="form-element" class="${this.hasLabel ? "form-label" : "hidden"}"
|
|
128
|
-
>${this.label ? unsafeHTML(this.label) : ""}<slot
|
|
129
|
+
>${this.label ? unsafeHTML(this.label + labelStarSuffix) : ""}<slot
|
|
130
|
+
name="label"
|
|
131
|
+
@slotchange=${this.onSlotChange}
|
|
132
|
+
></slot
|
|
129
133
|
></label>
|
|
130
134
|
|
|
131
135
|
<div class="form-control ${classMap(slotClasses)}">
|
|
File without changes
|
|
@@ -48,9 +48,13 @@ let Textarea = class Textarea extends FormInput(FormElement(Subscriber(LitElemen
|
|
|
48
48
|
textarea.reportValidity();
|
|
49
49
|
}
|
|
50
50
|
render() {
|
|
51
|
+
let labelStarSuffix = this.label && this.required && this.label.indexOf("*") == -1 ? " *" : "";
|
|
51
52
|
return html `
|
|
52
53
|
<label for="form-element" class="${this.hasLabel ? "form-label" : "hidden"}"
|
|
53
|
-
>${this.label ? unsafeHTML(this.label) : ""}<slot
|
|
54
|
+
>${this.label ? unsafeHTML(this.label + labelStarSuffix) : ""}<slot
|
|
55
|
+
name="label"
|
|
56
|
+
@slotchange=${this.onSlotChange}
|
|
57
|
+
></slot
|
|
54
58
|
></label>
|
|
55
59
|
|
|
56
60
|
<div class="form-control">
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -4,6 +4,8 @@ import "./button/button";
|
|
|
4
4
|
import "./link/link";
|
|
5
5
|
import "./progress/progress";
|
|
6
6
|
import "./form/input/input";
|
|
7
|
+
import "./form/input/password-helper";
|
|
8
|
+
import "./form/input/same-value-helper";
|
|
7
9
|
import "./form/checkbox/checkbox";
|
|
8
10
|
import "./form/radio/radio";
|
|
9
11
|
import "./form/select/select";
|
package/core/components/ui/ui.js
CHANGED
|
@@ -7,6 +7,8 @@ import "./link/link";
|
|
|
7
7
|
import "./progress/progress";
|
|
8
8
|
// FORMS
|
|
9
9
|
import "./form/input/input";
|
|
10
|
+
import "./form/input/password-helper";
|
|
11
|
+
import "./form/input/same-value-helper";
|
|
10
12
|
import "./form/checkbox/checkbox";
|
|
11
13
|
import "./form/radio/radio";
|
|
12
14
|
import "./form/select/select";
|
package/core/core.d.ts
CHANGED
|
File without changes
|
package/core/core.js
CHANGED
|
File without changes
|
package/core/mixins/Fetcher.d.ts
CHANGED
|
File without changes
|
package/core/mixins/Fetcher.js
CHANGED
|
@@ -86,14 +86,18 @@ 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
|
-
//
|
|
90
|
-
if (!data
|
|
89
|
+
// Je garde ça mais normalement ça n'arrive jamais
|
|
90
|
+
if (!data) {
|
|
91
91
|
SonicToast.add({ text: "Network Error", status: "error" });
|
|
92
92
|
this.isLoading = false;
|
|
93
93
|
if (hasLoader)
|
|
94
94
|
Loader.hide();
|
|
95
95
|
return;
|
|
96
96
|
}
|
|
97
|
+
// Si data ne contient que la réponse HTTP, avec un statut not ok, on affiche un message
|
|
98
|
+
else if (data._sonic_http_response_ && !data._sonic_http_response_.ok && Object.keys(data).length === 1) {
|
|
99
|
+
SonicToast.add({ text: "Network Error", status: "error" });
|
|
100
|
+
}
|
|
97
101
|
if (hasLoader)
|
|
98
102
|
Loader.hide();
|
|
99
103
|
if (this.key) {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/core/mixins/FormInput.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/core/mixins/mixins.d.ts
CHANGED
|
File without changes
|
package/core/mixins/mixins.js
CHANGED
|
File without changes
|
package/core/utils/Arrays.d.ts
CHANGED
|
File without changes
|
package/core/utils/Arrays.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/core/utils/Electron.d.ts
CHANGED
|
File without changes
|
package/core/utils/Electron.js
CHANGED
|
File without changes
|
package/core/utils/Format.d.ts
CHANGED
|
File without changes
|
package/core/utils/Format.js
CHANGED
|
File without changes
|
package/core/utils/HTML.d.ts
CHANGED
|
@@ -10,5 +10,13 @@ declare class HTML {
|
|
|
10
10
|
* @returns valeur de l'attribut ou null si l'attribut n'est pas trouvé
|
|
11
11
|
*/
|
|
12
12
|
static getAncestorAttributeValue(node: any, attributeName: string): string | null;
|
|
13
|
+
/**
|
|
14
|
+
* Lance le chargement d'un js et retourne une promise qui resoud à true lorsque le chargement à réussi et à false, sinon.
|
|
15
|
+
* */
|
|
16
|
+
static loadJS(src: string): Promise<unknown>;
|
|
17
|
+
/**
|
|
18
|
+
* Lance le chargement d'un css et retourne une promise qui resoud à true lorsque le chargement à réussi et à false, sinon.
|
|
19
|
+
* */
|
|
20
|
+
static loadCSS(src: string): Promise<unknown>;
|
|
13
21
|
}
|
|
14
22
|
export default HTML;
|
package/core/utils/HTML.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
1
10
|
class HTML {
|
|
2
11
|
/**
|
|
3
12
|
* retourne la langue de la page courante telle que défini via l'attribut lang de la balise html
|
|
@@ -29,5 +38,37 @@ class HTML {
|
|
|
29
38
|
}
|
|
30
39
|
return node.getAttribute(attributeName);
|
|
31
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Lance le chargement d'un js et retourne une promise qui resoud à true lorsque le chargement à réussi et à false, sinon.
|
|
43
|
+
* */
|
|
44
|
+
static loadJS(src) {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
const p = new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
let script = document.createElement("script");
|
|
48
|
+
script.src = src;
|
|
49
|
+
script.onload = () => resolve(true);
|
|
50
|
+
script.onerror = () => resolve(true);
|
|
51
|
+
document.head.appendChild(script);
|
|
52
|
+
}));
|
|
53
|
+
return p;
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Lance le chargement d'un css et retourne une promise qui resoud à true lorsque le chargement à réussi et à false, sinon.
|
|
58
|
+
* */
|
|
59
|
+
static loadCSS(src) {
|
|
60
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
const p = new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
|
|
62
|
+
var cssnode = document.createElement("link");
|
|
63
|
+
cssnode.type = "text/css";
|
|
64
|
+
cssnode.rel = "stylesheet";
|
|
65
|
+
cssnode.href = src;
|
|
66
|
+
cssnode.onload = () => resolve(true);
|
|
67
|
+
cssnode.onerror = () => resolve(true);
|
|
68
|
+
document.head.appendChild(cssnode);
|
|
69
|
+
}));
|
|
70
|
+
return p;
|
|
71
|
+
});
|
|
72
|
+
}
|
|
32
73
|
}
|
|
33
74
|
export default HTML;
|
|
File without changes
|
|
File without changes
|
package/core/utils/Objects.d.ts
CHANGED
|
File without changes
|
package/core/utils/Objects.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/core/utils/api.d.ts
CHANGED
|
File without changes
|
package/core/utils/api.js
CHANGED
|
File without changes
|