@supersoniks/concorde 1.1.49 → 2.0.1
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 +3288 -36
- package/concorde-core.es.js +13147 -9458
- package/core/_types/types.d.ts +0 -0
- package/core/_types/types.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 +2 -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/if/if.test.d.ts +0 -0
- package/core/components/functional/if/if.test.js +12 -21
- package/core/components/functional/list/list.d.ts +4 -0
- package/core/components/functional/list/list.js +24 -11
- package/core/components/functional/mix/mix.d.ts +0 -0
- package/core/components/functional/mix/mix.js +0 -0
- package/core/components/functional/queue/queue.d.ts +0 -0
- package/core/components/functional/queue/queue.js +34 -70
- 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 +1 -2
- package/core/components/functional/sdui/SDUIDescriptorTransformer.d.ts +0 -0
- package/core/components/functional/sdui/SDUIDescriptorTransformer.js +28 -43
- package/core/components/functional/sdui/default-library.json +0 -0
- package/core/components/functional/sdui/sdui-utils.d.ts +0 -0
- package/core/components/functional/sdui/sdui-utils.js +0 -0
- package/core/components/functional/sdui/sdui.d.ts +2 -0
- package/core/components/functional/sdui/sdui.js +24 -40
- package/core/components/functional/sdui/types.d.ts +0 -0
- package/core/components/functional/sdui/types.js +0 -0
- package/core/components/functional/sonic-scope/sonic-scope.d.ts +1 -1
- 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 +2 -4
- package/core/components/functional/submit/submit.d.ts +0 -0
- package/core/components/functional/submit/submit.js +106 -121
- package/core/components/functional/subscriber/subscriber.d.ts +0 -0
- package/core/components/functional/subscriber/subscriber.js +0 -0
- package/core/components/functional/value/value.d.ts +0 -0
- package/core/components/functional/value/value.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 +0 -0
- package/core/components/ui/alert/alert.js +0 -0
- 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 +2 -2
- package/core/components/ui/button/button.js +24 -41
- package/core/components/ui/captcha/captcha.d.ts +0 -0
- package/core/components/ui/captcha/captcha.js +3 -5
- 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 +1 -1
- package/core/components/ui/divider/divider.js +6 -6
- package/core/components/ui/form/checkbox/checkbox.d.ts +3 -23
- package/core/components/ui/form/checkbox/checkbox.js +7 -12
- 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 +1 -1
- package/core/components/ui/form/form-layout/form-layout.js +1 -1
- package/core/components/ui/form/input/input.d.ts +4 -6
- package/core/components/ui/form/input/input.js +12 -18
- package/core/components/ui/form/input/password-helper.d.ts +0 -0
- package/core/components/ui/form/input/password-helper.js +0 -0
- package/core/components/ui/form/input/same-value-helper.d.ts +0 -0
- package/core/components/ui/form/input/same-value-helper.js +0 -0
- package/core/components/ui/form/input-autocomplete/input-autocomplete.d.ts +5 -20
- package/core/components/ui/form/input-autocomplete/input-autocomplete.js +27 -93
- 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 +1 -1
- package/core/components/ui/form/select/select.js +15 -25
- package/core/components/ui/form/textarea/textarea.d.ts +3 -3
- package/core/components/ui/form/textarea/textarea.js +8 -17
- package/core/components/ui/group/group.d.ts +0 -0
- package/core/components/ui/group/group.js +7 -15
- package/core/components/ui/icon/icon.d.ts +6 -12
- package/core/components/ui/icon/icon.js +20 -53
- package/core/components/ui/icon/icons.d.ts +0 -0
- package/core/components/ui/icon/icons.js +30 -22
- package/core/components/ui/icon/icons.json +0 -0
- package/core/components/ui/image/image.d.ts +1 -1
- package/core/components/ui/image/image.js +3 -3
- 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 +2 -4
- package/core/components/ui/modal/modal-actions.d.ts +1 -1
- package/core/components/ui/modal/modal-actions.js +4 -4
- 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 +10 -12
- package/core/components/ui/pop/pop.d.ts +0 -0
- package/core/components/ui/pop/pop.js +3 -4
- 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 +5 -6
- 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 +5 -6
- 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 +8 -1
- package/core/components/ui/table/table.d.ts +1 -0
- package/core/components/ui/table/table.js +9 -1
- package/core/components/ui/theme/css/tailwind.css +0 -0
- package/core/components/ui/theme/css/tailwind.d.ts +0 -0
- package/core/components/ui/theme/theme-collection/core-variables.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 +5 -6
- package/core/components/ui/toast/message-subscriber.d.ts +0 -0
- package/core/components/ui/toast/message-subscriber.js +6 -8
- 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 +15 -6
- 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 +1 -1
- package/core/components/ui/tooltip/tooltip.js +0 -0
- package/core/components/ui/ui.d.ts +0 -0
- package/core/components/ui/ui.js +0 -0
- package/core/core.d.ts +0 -0
- package/core/core.js +9 -0
- package/core/decorators/Subscriber.d.ts +0 -0
- package/core/decorators/Subscriber.js +0 -1
- package/core/directives/DataProvider.d.ts +0 -14
- package/core/directives/DataProvider.js +1 -16
- package/core/mixins/Fetcher.d.ts +2 -0
- package/core/mixins/Fetcher.js +67 -79
- package/core/mixins/FormCheckable.d.ts +0 -0
- package/core/mixins/FormCheckable.js +2 -3
- package/core/mixins/FormElement.d.ts +0 -0
- package/core/mixins/FormElement.js +5 -7
- package/core/mixins/FormInput.d.ts +1 -1
- package/core/mixins/FormInput.js +1 -2
- package/core/mixins/Subscriber.d.ts +0 -0
- package/core/mixins/Subscriber.js +39 -54
- 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 +2 -1
- package/core/utils/DataBindObserver.d.ts +0 -0
- package/core/utils/DataBindObserver.js +5 -6
- package/core/utils/Electron.d.ts +0 -0
- package/core/utils/Electron.js +1 -1
- package/core/utils/Format.d.ts +0 -0
- package/core/utils/Format.js +0 -0
- package/core/utils/HTML.d.ts +0 -0
- package/core/utils/HTML.js +18 -31
- package/core/utils/LocationHandler.d.ts +0 -0
- package/core/utils/LocationHandler.js +8 -13
- package/core/utils/Objects.d.ts +0 -0
- package/core/utils/Objects.js +0 -0
- package/core/utils/PublisherProxy.d.ts +0 -0
- package/core/utils/PublisherProxy.js +108 -132
- package/core/utils/Utils.d.ts +0 -0
- package/core/utils/Utils.js +3 -14
- package/core/utils/api.d.ts +0 -0
- package/core/utils/api.js +137 -165
- package/img/concorde-logo.svg +0 -0
- package/img/concorde.png +0 -0
- package/img/concorde_def.png +0 -0
- package/mixins.d.ts +5 -3
- package/mixins.js +0 -0
- package/package.json +13 -12
- package/svg/regular/plane.svg +0 -0
- package/svg/solid/plane.svg +0 -0
- package/test-utils/TestUtils.d.ts +0 -0
- package/test-utils/TestUtils.js +0 -0
- package/utils.d.ts +0 -0
- package/utils.js +0 -0
|
File without changes
|
|
@@ -35,13 +35,12 @@ let MessageSubscriber = class MessageSubscriber extends Subscriber(LitElement, {
|
|
|
35
35
|
return this._message;
|
|
36
36
|
}
|
|
37
37
|
set message(value) {
|
|
38
|
-
var _a, _b;
|
|
39
38
|
this._message = value;
|
|
40
39
|
if (!this.message)
|
|
41
40
|
return;
|
|
42
|
-
if (
|
|
41
|
+
if (this.props?.success !== false)
|
|
43
42
|
return;
|
|
44
|
-
if (
|
|
43
|
+
if (this.props?.public_message)
|
|
45
44
|
return;
|
|
46
45
|
//OUi OUi il faut afficher "message" que si success est parfaitement égal à false et qu'il n'y a rien dans public_message.
|
|
47
46
|
SonicToast.add({ text: this.message, status: "error" });
|
|
@@ -50,16 +49,15 @@ let MessageSubscriber = class MessageSubscriber extends Subscriber(LitElement, {
|
|
|
50
49
|
return this._data;
|
|
51
50
|
}
|
|
52
51
|
set data(value) {
|
|
53
|
-
var _a, _b, _c, _d;
|
|
54
52
|
this._data = value;
|
|
55
53
|
const toastOptions = { text: "Votre produit a bien été ajouté", status: "success" };
|
|
56
|
-
if (Array.isArray(this.data) &&
|
|
54
|
+
if (Array.isArray(this.data) && this.props?.success === true)
|
|
57
55
|
SonicToast.add(toastOptions);
|
|
58
|
-
if (this.data == "" &&
|
|
56
|
+
if (this.data == "" && this.props?.status === true)
|
|
59
57
|
SonicToast.add(toastOptions);
|
|
60
|
-
if (
|
|
58
|
+
if (this.props?.success !== false)
|
|
61
59
|
return;
|
|
62
|
-
if (
|
|
60
|
+
if (this.props?.public_message)
|
|
63
61
|
return;
|
|
64
62
|
SonicToast.add({ text: this.data, status: "error" });
|
|
65
63
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -32,7 +32,17 @@ let SonicToast = class SonicToast extends LitElement {
|
|
|
32
32
|
margin: "1rem",
|
|
33
33
|
};
|
|
34
34
|
if (!isIframe) {
|
|
35
|
-
styles =
|
|
35
|
+
styles = {
|
|
36
|
+
...styles,
|
|
37
|
+
margin: "0",
|
|
38
|
+
width: "calc(100% - 2.5rem)",
|
|
39
|
+
position: "fixed",
|
|
40
|
+
bottom: "1.25rem",
|
|
41
|
+
right: "1.25rem",
|
|
42
|
+
zIndex: "10000",
|
|
43
|
+
maxWidth: "64ch",
|
|
44
|
+
flexDirection: "column-reverse",
|
|
45
|
+
};
|
|
36
46
|
}
|
|
37
47
|
// ${window.parent == window ? "fixed-area" : ""}
|
|
38
48
|
if (!this.toasts)
|
|
@@ -79,7 +89,6 @@ let SonicToast = class SonicToast extends LitElement {
|
|
|
79
89
|
}
|
|
80
90
|
// ADD TOAST
|
|
81
91
|
static add(conf) {
|
|
82
|
-
var _a;
|
|
83
92
|
// Init toast area si absente (au <sonic-theme> ou <body< à défaut)
|
|
84
93
|
if (!document.querySelector("sonic-toast")) {
|
|
85
94
|
const toastComponent = document.createElement("sonic-toast");
|
|
@@ -88,7 +97,7 @@ let SonicToast = class SonicToast extends LitElement {
|
|
|
88
97
|
}
|
|
89
98
|
// Ajoute le toast à la liste
|
|
90
99
|
const toastComponent = document.querySelector("sonic-toast");
|
|
91
|
-
const nextId =
|
|
100
|
+
const nextId = conf.id ?? new Date().valueOf();
|
|
92
101
|
const interactiveRegExp = new RegExp("</a>|</.*?button>|</.*?input>|</.*?textarea>|</.*?select>");
|
|
93
102
|
const hasInteractive = interactiveRegExp.test(conf.text);
|
|
94
103
|
const currentToast = {
|
|
@@ -109,9 +118,9 @@ let SonicToast = class SonicToast extends LitElement {
|
|
|
109
118
|
}
|
|
110
119
|
}
|
|
111
120
|
if (toastComponent.toasts.length > 0) {
|
|
112
|
-
const toastA =
|
|
121
|
+
const toastA = { ...currentToast };
|
|
113
122
|
for (const toast of toastComponent.toasts) {
|
|
114
|
-
const toastB =
|
|
123
|
+
const toastB = { ...toast };
|
|
115
124
|
toastA.id = toastB.id = 0;
|
|
116
125
|
if ( /*!currentToast.preserve && */Objects.shallowEqual(toastA, toastB)) {
|
|
117
126
|
return null;
|
|
@@ -132,7 +141,7 @@ let SonicToast = class SonicToast extends LitElement {
|
|
|
132
141
|
if (!toastToRemove)
|
|
133
142
|
return;
|
|
134
143
|
this.toasts = this.toasts.filter((toast) => {
|
|
135
|
-
toast =
|
|
144
|
+
toast = { ...toast };
|
|
136
145
|
delete toast.id;
|
|
137
146
|
return !Objects.shallowEqual(toast, toastToRemove, false);
|
|
138
147
|
});
|
|
File without changes
|
|
File without changes
|
|
@@ -2,7 +2,7 @@ import { LitElement } from "lit";
|
|
|
2
2
|
export declare class Tooltip extends LitElement {
|
|
3
3
|
static styles: import("lit").CSSResult[];
|
|
4
4
|
label: string;
|
|
5
|
-
placement?: "top" | "bottom";
|
|
5
|
+
placement?: "top" | "bottom" | "left" | "right";
|
|
6
6
|
disabled: boolean;
|
|
7
7
|
render(): import("lit-html").TemplateResult<1>;
|
|
8
8
|
}
|
|
File without changes
|
|
File without changes
|
package/core/components/ui/ui.js
CHANGED
|
File without changes
|
package/core/core.d.ts
CHANGED
|
File without changes
|
package/core/core.js
CHANGED
|
@@ -7,3 +7,12 @@ if (!window.SonicPublisherManager)
|
|
|
7
7
|
window.SonicPublisherManager = PublisherManager;
|
|
8
8
|
if (!window.SonicDataBindObserver)
|
|
9
9
|
window.SonicDataBindObserver = DataBindObserver;
|
|
10
|
+
window.queueMicrotask =
|
|
11
|
+
window.queueMicrotask ||
|
|
12
|
+
function (callback) {
|
|
13
|
+
Promise.resolve()
|
|
14
|
+
.then(callback)
|
|
15
|
+
.catch((e) => setTimeout(() => {
|
|
16
|
+
throw e;
|
|
17
|
+
}));
|
|
18
|
+
};
|
|
File without changes
|
|
@@ -12,21 +12,7 @@ declare class ObserveDirective extends AsyncDirective {
|
|
|
12
12
|
}
|
|
13
13
|
export declare const subscribe: (observable: any) => import("lit-html/directive").DirectiveResult<typeof ObserveDirective>;
|
|
14
14
|
export declare const sub: (observable: any) => import("lit-html/directive").DirectiveResult<typeof ObserveDirective>;
|
|
15
|
-
export declare const fresh: (observable: any) => import("lit-html/directive").DirectiveResult<typeof ObserveDirective>;
|
|
16
|
-
export declare const autoUpdate: (observable: any) => import("lit-html/directive").DirectiveResult<typeof ObserveDirective>;
|
|
17
|
-
export declare const auto: (observable: any) => import("lit-html/directive").DirectiveResult<typeof ObserveDirective>;
|
|
18
|
-
export declare const r: (observable: any) => import("lit-html/directive").DirectiveResult<typeof ObserveDirective>;
|
|
19
|
-
export declare const react: (observable: any) => import("lit-html/directive").DirectiveResult<typeof ObserveDirective>;
|
|
20
|
-
export declare const reactive: (observable: any) => import("lit-html/directive").DirectiveResult<typeof ObserveDirective>;
|
|
21
|
-
export declare const current: (observable: any) => import("lit-html/directive").DirectiveResult<typeof ObserveDirective>;
|
|
22
|
-
export declare const bind: (observable: any) => import("lit-html/directive").DirectiveResult<typeof ObserveDirective>;
|
|
23
|
-
export declare const watch: (observable: any) => import("lit-html/directive").DirectiveResult<typeof ObserveDirective>;
|
|
24
|
-
export declare const observe: (observable: any) => import("lit-html/directive").DirectiveResult<typeof ObserveDirective>;
|
|
25
15
|
export declare const get: (id: string | any) => any;
|
|
26
|
-
export declare const value: (id: string | any) => any;
|
|
27
|
-
export declare const val: (id: string | any) => any;
|
|
28
|
-
export declare const v: (id: string | any) => any;
|
|
29
16
|
export declare const dataProvider: (id: any) => any;
|
|
30
17
|
export declare const dp: (id: any) => any;
|
|
31
|
-
export declare const proxy: (id: any) => any;
|
|
32
18
|
export {};
|
|
@@ -63,8 +63,7 @@ class ObserveDirective extends AsyncDirective {
|
|
|
63
63
|
// When the directive is disconnected from the DOM, unsubscribe to ensure
|
|
64
64
|
// the directive instance can be garbage collected
|
|
65
65
|
disconnected() {
|
|
66
|
-
|
|
67
|
-
(_a = this.unsubscribe) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
66
|
+
this.unsubscribe?.();
|
|
68
67
|
}
|
|
69
68
|
// If the subtree the directive is in was disconnected and subsequently
|
|
70
69
|
// re-connected, re-subscribe to make the directive operable again
|
|
@@ -79,24 +78,10 @@ const dir = directive(ObserveDirective);
|
|
|
79
78
|
//autoUpdate directive
|
|
80
79
|
export const subscribe = dir;
|
|
81
80
|
export const sub = dir;
|
|
82
|
-
export const fresh = dir;
|
|
83
|
-
export const autoUpdate = dir;
|
|
84
|
-
export const auto = dir;
|
|
85
|
-
export const r = dir;
|
|
86
|
-
export const react = dir;
|
|
87
|
-
export const reactive = dir;
|
|
88
|
-
export const current = dir;
|
|
89
|
-
export const bind = dir;
|
|
90
|
-
export const watch = dir;
|
|
91
|
-
export const observe = dir;
|
|
92
81
|
// get value
|
|
93
82
|
export const get = (id) => {
|
|
94
83
|
return getObservables(id).values().next().value.get();
|
|
95
84
|
};
|
|
96
|
-
export const value = get;
|
|
97
|
-
export const val = get;
|
|
98
|
-
export const v = get;
|
|
99
85
|
const deepee = (id) => getObservables(id).values().next();
|
|
100
86
|
export const dataProvider = deepee;
|
|
101
87
|
export const dp = deepee;
|
|
102
|
-
export const proxy = deepee;
|
package/core/mixins/Fetcher.d.ts
CHANGED
|
@@ -22,6 +22,8 @@ declare const Fetcher: <T extends Constructor<SubscriberInterface<PropsType>>, P
|
|
|
22
22
|
* isLoading vaut true pendant le chargement des données
|
|
23
23
|
*/
|
|
24
24
|
isLoading: boolean;
|
|
25
|
+
lazyLoad?: boolean | undefined;
|
|
26
|
+
noLoader?: boolean | undefined;
|
|
25
27
|
/**
|
|
26
28
|
* IObserver est l'intersection observer qui permet de charger les données au scroll si l'attribut lazyload est renseigné
|
|
27
29
|
*/
|
package/core/mixins/Fetcher.js
CHANGED
|
@@ -4,15 +4,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
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
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
8
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
9
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
10
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
11
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
12
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
13
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
14
|
-
});
|
|
15
|
-
};
|
|
16
7
|
import "@supersoniks/concorde/core/components/ui/button/button";
|
|
17
8
|
import { Loader } from "@supersoniks/concorde/core/components/ui/loader/loader";
|
|
18
9
|
import { SonicToast } from "@supersoniks/concorde/core/components/ui/toast/toast";
|
|
@@ -78,81 +69,81 @@ const Fetcher = (superClass, propsType) => {
|
|
|
78
69
|
* Elles sont ensuite injectées dans le publisher en accord avec la cible définie dans la propriété key
|
|
79
70
|
* Un Toast est affiché si le chargement échoue
|
|
80
71
|
*/
|
|
81
|
-
_fetchData() {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
72
|
+
async _fetchData() {
|
|
73
|
+
if (!this.isFetchEnabled)
|
|
74
|
+
return;
|
|
75
|
+
this.api = new API(this.getApiConfiguration());
|
|
76
|
+
if (!this.api)
|
|
77
|
+
return;
|
|
78
|
+
// if (!this.dataProvider) return;
|
|
79
|
+
this.dispatchEvent(new CustomEvent("loading", { detail: this }));
|
|
80
|
+
if (this.getAttribute("localStorage") === "enabled") {
|
|
81
|
+
await PublisherManager.getInstance().isLocalStrorageReady;
|
|
82
|
+
}
|
|
83
|
+
if (!this.isConnected)
|
|
84
|
+
return;
|
|
85
|
+
const hasLoader = this.isDefaultLoaderEnabled && !this.noLoader;
|
|
86
|
+
if (hasLoader) {
|
|
87
|
+
Loader.show();
|
|
88
|
+
}
|
|
89
|
+
const headerData = PublisherManager.getInstance().get(this.getAncestorAttributeValue("headersDataProvider")).get();
|
|
90
|
+
this.isLoading = true;
|
|
91
|
+
if (Objects.isObject(this.props) && Object.keys(this.props || {}).length > 0 && this.isFirstLoad) {
|
|
92
|
+
window.requestAnimationFrame(() => {
|
|
102
93
|
this.dispatchEvent(new CustomEvent("load", { detail: this }));
|
|
103
94
|
this.isFirstLoad = false;
|
|
104
95
|
this.isLoading = false;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
// Je garde ça mais normalement ça n'arrive jamais
|
|
113
|
-
if (!data) {
|
|
114
|
-
SonicToast.add({ text: "Network Error", status: "error" });
|
|
115
|
-
this.isLoading = false;
|
|
116
|
-
if (hasLoader) {
|
|
117
|
-
Loader.hide();
|
|
118
|
-
}
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
// Si data ne contient que la réponse HTTP, avec un statut not ok, on affiche un message
|
|
122
|
-
else if (data._sonic_http_response_ && !data._sonic_http_response_.ok && Object.keys(data).length === 1) {
|
|
123
|
-
SonicToast.add({ text: "Network Error", status: "error" });
|
|
124
|
-
}
|
|
125
|
-
if (hasLoader) {
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
let data = await this.api.get(this.endPoint || this.dataProvider || "", headerData);
|
|
99
|
+
if (!this.isConnected) {
|
|
100
|
+
if (hasLoader)
|
|
126
101
|
Loader.hide();
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
*/
|
|
133
|
-
data = Objects.traverse(data, this.key.split("."), this.hasAttribute("preserveOtherKeys"));
|
|
134
|
-
if (data && Objects.isObject(data) && response)
|
|
135
|
-
data._sonic_http_response_ = response;
|
|
136
|
-
}
|
|
137
|
-
this.props = data;
|
|
138
|
-
this.dispatchEvent(new CustomEvent("load", { detail: this }));
|
|
139
|
-
this.isFirstLoad = false;
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
// Je garde ça mais normalement ça n'arrive jamais
|
|
105
|
+
if (!data) {
|
|
106
|
+
SonicToast.add({ text: "Network Error", status: "error" });
|
|
140
107
|
this.isLoading = false;
|
|
141
|
-
if (
|
|
142
|
-
|
|
108
|
+
if (hasLoader) {
|
|
109
|
+
Loader.hide();
|
|
143
110
|
}
|
|
144
|
-
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
// Si data ne contient que la réponse HTTP, avec un statut not ok, on affiche un message
|
|
114
|
+
else if (data._sonic_http_response_ && !data._sonic_http_response_.ok && Object.keys(data).length === 1) {
|
|
115
|
+
SonicToast.add({ text: "Network Error", status: "error" });
|
|
116
|
+
}
|
|
117
|
+
if (hasLoader) {
|
|
118
|
+
Loader.hide();
|
|
119
|
+
}
|
|
120
|
+
if (this.key) {
|
|
121
|
+
const response = data._sonic_http_response_;
|
|
122
|
+
/* preserveOtherKeys s'exprime lorsque le paramètre "key" est défini
|
|
123
|
+
* Conserve les autres propriétés de l'objet reçu, en plus des propriétés définies sous "key"
|
|
124
|
+
*/
|
|
125
|
+
data = Objects.traverse(data, this.key.split("."), this.hasAttribute("preserveOtherKeys"));
|
|
126
|
+
if (data && Objects.isObject(data) && response)
|
|
127
|
+
data._sonic_http_response_ = response;
|
|
128
|
+
}
|
|
129
|
+
this.props = data;
|
|
130
|
+
this.dispatchEvent(new CustomEvent("load", { detail: this }));
|
|
131
|
+
this.isFirstLoad = false;
|
|
132
|
+
this.isLoading = false;
|
|
133
|
+
if (this.refetchEveryMs && this.isConnected) {
|
|
134
|
+
this.refetchTimeOutId = setTimeout(() => this._fetchData(), this.refetchEveryMs);
|
|
135
|
+
}
|
|
145
136
|
}
|
|
146
137
|
disconnectedCallback() {
|
|
147
|
-
var _a;
|
|
148
138
|
super.disconnectedCallback();
|
|
149
|
-
|
|
139
|
+
this.publisher?.offInvalidate(this.onInvalidate);
|
|
150
140
|
clearTimeout(this.refetchTimeOutId);
|
|
151
141
|
this.isFirstLoad = false;
|
|
152
142
|
}
|
|
153
143
|
connectedCallback() {
|
|
154
|
-
var _a;
|
|
155
144
|
// this.noShadowDom = "";
|
|
145
|
+
this.lazyLoad = this.lazyLoad !== undefined ? this.lazyLoad : this.hasAttribute("lazyload");
|
|
146
|
+
this.noLoader = this.noLoader !== undefined ? this.noLoader : this.hasAttribute("noloader");
|
|
156
147
|
super.connectedCallback();
|
|
157
148
|
if (!this.isFetchEnabled) {
|
|
158
149
|
return;
|
|
@@ -162,9 +153,8 @@ const Fetcher = (superClass, propsType) => {
|
|
|
162
153
|
this.publisher.set(this.props);
|
|
163
154
|
}
|
|
164
155
|
this.onInvalidate = () => this._fetchData();
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
if (lazyLoad === null) {
|
|
156
|
+
this.publisher?.onInvalidate(this.onInvalidate);
|
|
157
|
+
if (!this.lazyLoad) {
|
|
168
158
|
this._fetchData();
|
|
169
159
|
}
|
|
170
160
|
else {
|
|
@@ -172,8 +162,7 @@ const Fetcher = (superClass, propsType) => {
|
|
|
172
162
|
}
|
|
173
163
|
}
|
|
174
164
|
handleLazyLoad() {
|
|
175
|
-
|
|
176
|
-
if (lazyLoad === null) {
|
|
165
|
+
if (!this.lazyLoad) {
|
|
177
166
|
return;
|
|
178
167
|
}
|
|
179
168
|
const rect = this.getBoundingClientRect();
|
|
@@ -188,7 +177,7 @@ const Fetcher = (superClass, propsType) => {
|
|
|
188
177
|
};
|
|
189
178
|
this.iObserver = new IntersectionObserver((entries) => this.onIntersection(entries), options);
|
|
190
179
|
let elt = (this.shadowRoot ? this.shadowRoot.children[0] : this.children[0]);
|
|
191
|
-
if (
|
|
180
|
+
if (elt?.nodeName.toLocaleLowerCase() == "slot")
|
|
192
181
|
elt = elt.children[0];
|
|
193
182
|
if (!elt || elt.nodeName.toLocaleLowerCase() == "template") {
|
|
194
183
|
elt = document.createElement("span");
|
|
@@ -209,13 +198,12 @@ const Fetcher = (superClass, propsType) => {
|
|
|
209
198
|
}
|
|
210
199
|
}
|
|
211
200
|
onIntersection(entries) {
|
|
212
|
-
var _a, _b;
|
|
213
201
|
for (const e of entries) {
|
|
214
202
|
if (e.isIntersecting && this.isFirstLoad) {
|
|
215
203
|
this._fetchData();
|
|
216
|
-
|
|
204
|
+
this.lazyLoadSpan?.remove();
|
|
217
205
|
this.lazyLoadSpan = undefined;
|
|
218
|
-
|
|
206
|
+
this.iObserver?.disconnect();
|
|
219
207
|
break;
|
|
220
208
|
}
|
|
221
209
|
}
|
|
File without changes
|
|
@@ -40,7 +40,7 @@ const Form = (superClass) => {
|
|
|
40
40
|
const name = this.getAttribute("name");
|
|
41
41
|
const checkAllPublisher = this.getCheckAllPublisher();
|
|
42
42
|
const formPublisher = this.getFormPublisher();
|
|
43
|
-
if (!
|
|
43
|
+
if (!checkAllPublisher?.hasCheckAll.get()) {
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
46
|
if (!this.checksAll() && checkAllPublisher && formPublisher && name) {
|
|
@@ -147,8 +147,7 @@ const Form = (superClass) => {
|
|
|
147
147
|
this.requestUpdate();
|
|
148
148
|
}
|
|
149
149
|
validateFormElement() {
|
|
150
|
-
|
|
151
|
-
const input = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector("input");
|
|
150
|
+
const input = this.shadowRoot?.querySelector("input");
|
|
152
151
|
if (!input || input.checkValidity())
|
|
153
152
|
return;
|
|
154
153
|
const formPublisher = this.getFormPublisher();
|
|
File without changes
|
|
@@ -176,20 +176,18 @@ const Form = (superClass) => {
|
|
|
176
176
|
keyboardLoops.set(keyboardLoopId2, []);
|
|
177
177
|
}
|
|
178
178
|
const keyboardLoop = keyboardLoops.get(keyboardLoopId2);
|
|
179
|
-
if (
|
|
179
|
+
if (keyboardLoop?.indexOf(this) == -1) {
|
|
180
180
|
keyboardLoop.push(this);
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
const keyboardLoop = keyboardLoops.get(keyboardLoopId);
|
|
184
184
|
this.addEventListener("keydown", (e) => {
|
|
185
|
-
var _a;
|
|
186
185
|
const keyboardEvent = e;
|
|
187
186
|
if (!["ArrowDown", "ArrowUp"].includes(keyboardEvent.key))
|
|
188
187
|
return;
|
|
189
188
|
const selector = "input:not([disabled]), button:not([disabled]), select:not([disabled]), textarea:not([disabled])";
|
|
190
|
-
const loop = keyboardLoop
|
|
191
|
-
|
|
192
|
-
const child = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(selector);
|
|
189
|
+
const loop = keyboardLoop?.filter((el) => {
|
|
190
|
+
const child = el.shadowRoot?.querySelector(selector);
|
|
193
191
|
if (!child)
|
|
194
192
|
return false;
|
|
195
193
|
const cpStyle = window.getComputedStyle(child);
|
|
@@ -218,7 +216,7 @@ const Form = (superClass) => {
|
|
|
218
216
|
next = loop[index - 1];
|
|
219
217
|
}
|
|
220
218
|
}
|
|
221
|
-
const elt =
|
|
219
|
+
const elt = next?.shadowRoot?.querySelector(selector);
|
|
222
220
|
if (elt && elt.focus) {
|
|
223
221
|
elt.focus();
|
|
224
222
|
e.preventDefault();
|
|
@@ -255,7 +253,7 @@ const Form = (superClass) => {
|
|
|
255
253
|
property({ type: Boolean })
|
|
256
254
|
], FormElement.prototype, "required", void 0);
|
|
257
255
|
__decorate([
|
|
258
|
-
property()
|
|
256
|
+
property({ type: Boolean })
|
|
259
257
|
], FormElement.prototype, "forceAutoFill", void 0);
|
|
260
258
|
__decorate([
|
|
261
259
|
property({ type: Boolean })
|
|
@@ -17,7 +17,7 @@ declare const Form: <T extends Constructor<FormElementInterface>>(superClass: T)
|
|
|
17
17
|
_label?: string | undefined;
|
|
18
18
|
label: string | undefined;
|
|
19
19
|
tabindex?: number | undefined;
|
|
20
|
-
autocomplete?: "url" | "name" | "
|
|
20
|
+
autocomplete?: "url" | "name" | "on" | "additional-name" | "address-level1" | "address-level2" | "address-level3" | "address-level4" | "address-line1" | "address-line2" | "address-line3" | "bday-day" | "bday-month" | "bday-year" | "cc-csc" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-family-name" | "cc-given-name" | "cc-name" | "cc-number" | "cc-type" | "country" | "country-name" | "current-password" | "family-name" | "given-name" | "honorific-prefix" | "honorific-suffix" | "new-password" | "one-time-code" | "organization" | "postal-code" | "street-address" | "transaction-amount" | "transaction-currency" | "username" | "email" | "tel" | "tel-area-code" | "tel-country-code" | "tel-extension" | "tel-local" | "tel-national" | "language" | "nickname" | "organization-title" | "cc-additional-name" | "bday" | "sex" | "impp" | "photo" | undefined;
|
|
21
21
|
getFormPublisher(): any;
|
|
22
22
|
updateDataValue(): void;
|
|
23
23
|
handleChange(e?: Event | undefined): void;
|
package/core/mixins/FormInput.js
CHANGED
|
@@ -18,8 +18,7 @@ const Form = (superClass) => {
|
|
|
18
18
|
args;
|
|
19
19
|
}
|
|
20
20
|
validateFormElement() {
|
|
21
|
-
|
|
22
|
-
const input = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector("input");
|
|
21
|
+
const input = this.shadowRoot?.querySelector("input");
|
|
23
22
|
if (!input || input.checkValidity())
|
|
24
23
|
return;
|
|
25
24
|
const formPublisher = this.getFormPublisher();
|
|
File without changes
|