@supersoniks/concorde 3.1.56 → 3.1.58
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/build-infos.json +1 -1
- package/concorde-core.bundle.js +54 -41
- package/concorde-core.es.js +310 -269
- package/dist/concorde-core.bundle.js +54 -41
- package/dist/concorde-core.es.js +310 -269
- package/docs/assets/index-D9bBwsCn.js +4537 -0
- package/docs/assets/index-DCRPZO3x.css +1 -0
- package/docs/css/docs.css +0 -0
- package/docs/fonts/ClashGrotesk-Bold.eot +0 -0
- package/docs/fonts/ClashGrotesk-Bold.ttf +0 -0
- package/docs/fonts/ClashGrotesk-Bold.woff +0 -0
- package/docs/fonts/ClashGrotesk-Bold.woff2 +0 -0
- package/docs/fonts/ClashGrotesk-Extralight.eot +0 -0
- package/docs/fonts/ClashGrotesk-Extralight.ttf +0 -0
- package/docs/fonts/ClashGrotesk-Extralight.woff +0 -0
- package/docs/fonts/ClashGrotesk-Extralight.woff2 +0 -0
- package/docs/fonts/ClashGrotesk-Light.eot +0 -0
- package/docs/fonts/ClashGrotesk-Light.ttf +0 -0
- package/docs/fonts/ClashGrotesk-Light.woff +0 -0
- package/docs/fonts/ClashGrotesk-Light.woff2 +0 -0
- package/docs/fonts/ClashGrotesk-Medium.eot +0 -0
- package/docs/fonts/ClashGrotesk-Medium.ttf +0 -0
- package/docs/fonts/ClashGrotesk-Medium.woff +0 -0
- package/docs/fonts/ClashGrotesk-Medium.woff2 +0 -0
- package/docs/fonts/ClashGrotesk-Regular.eot +0 -0
- package/docs/fonts/ClashGrotesk-Regular.ttf +0 -0
- package/docs/fonts/ClashGrotesk-Regular.woff +0 -0
- package/docs/fonts/ClashGrotesk-Regular.woff2 +0 -0
- package/docs/fonts/ClashGrotesk-Semibold.eot +0 -0
- package/docs/fonts/ClashGrotesk-Semibold.ttf +0 -0
- package/docs/fonts/ClashGrotesk-Semibold.woff +0 -0
- package/docs/fonts/ClashGrotesk-Semibold.woff2 +0 -0
- package/docs/fonts/ClashGrotesk-Variable.eot +0 -0
- package/docs/fonts/ClashGrotesk-Variable.ttf +0 -0
- package/docs/fonts/ClashGrotesk-Variable.woff +0 -0
- package/docs/fonts/ClashGrotesk-Variable.woff2 +0 -0
- package/docs/img/concorde-icon.svg +5 -0
- package/docs/img/concorde-logo.svg +1 -0
- package/docs/img/concorde.png +0 -0
- package/docs/img/concorde_def.png +0 -0
- package/docs/img/concorde_seuil.png.webp +0 -0
- package/docs/img/concorde_seuil_invert.png +0 -0
- package/docs/img/paul_metrand.jpg +0 -0
- package/docs/img/paul_metrand_xs.jpg +0 -0
- package/docs/index.html +93 -0
- package/docs/src/core/components/functional/date/date.md +290 -0
- package/docs/src/core/components/functional/fetch/fetch.md +117 -0
- package/docs/src/core/components/functional/if/if.md +16 -0
- package/docs/src/core/components/functional/list/list.md +199 -0
- package/docs/src/core/components/functional/mix/mix.md +41 -0
- package/docs/src/core/components/functional/queue/queue.md +87 -0
- package/docs/src/core/components/functional/router/router.md +108 -0
- package/docs/src/core/components/functional/sdui/default-library.json +108 -0
- package/docs/src/core/components/functional/sdui/example.json +99 -0
- package/docs/src/core/components/functional/sdui/sdui.md +356 -0
- package/docs/src/core/components/functional/states/states.md +87 -0
- package/docs/src/core/components/functional/submit/submit.md +83 -0
- package/docs/src/core/components/functional/subscriber/subscriber.md +91 -0
- package/docs/src/core/components/functional/value/value.md +35 -0
- package/docs/src/core/components/ui/alert/alert.md +121 -0
- package/docs/src/core/components/ui/alert-messages/alert-messages.md +0 -0
- package/docs/src/core/components/ui/badge/badge.md +127 -0
- package/docs/src/core/components/ui/button/button.md +182 -0
- package/docs/src/core/components/ui/captcha/captcha.md +12 -0
- package/docs/src/core/components/ui/card/card.md +97 -0
- package/docs/src/core/components/ui/divider/divider.md +35 -0
- package/docs/src/core/components/ui/form/checkbox/checkbox.md +94 -0
- package/docs/src/core/components/ui/form/fieldset/fieldset.md +129 -0
- package/docs/src/core/components/ui/form/form-actions/form-actions.md +77 -0
- package/docs/src/core/components/ui/form/form-layout/form-layout.md +44 -0
- package/docs/src/core/components/ui/form/input/input.md +167 -0
- package/docs/src/core/components/ui/form/input-autocomplete/input-autocomplete.md +130 -0
- package/docs/src/core/components/ui/form/radio/radio.md +84 -0
- package/docs/src/core/components/ui/form/select/select.md +97 -0
- package/docs/src/core/components/ui/form/switch/switch.md +84 -0
- package/docs/src/core/components/ui/form/textarea/textarea.md +65 -0
- package/docs/src/core/components/ui/group/group.md +75 -0
- package/docs/src/core/components/ui/icon/icon.md +125 -0
- package/docs/src/core/components/ui/icon/icons.json +1 -0
- package/docs/src/core/components/ui/image/image.md +107 -0
- package/docs/src/core/components/ui/link/link.md +43 -0
- package/docs/src/core/components/ui/loader/loader.md +67 -0
- package/docs/src/core/components/ui/menu/menu.md +288 -0
- package/docs/src/core/components/ui/modal/modal.md +123 -0
- package/docs/src/core/components/ui/pop/pop.md +79 -0
- package/docs/src/core/components/ui/progress/progress.md +63 -0
- package/docs/src/core/components/ui/table/table.md +455 -0
- package/docs/src/core/components/ui/tooltip/tooltip.md +82 -0
- package/docs/src/docs/_core-concept/overview.md +57 -0
- package/docs/src/docs/_core-concept/subscriber.md +76 -0
- package/docs/src/docs/_getting-started/concorde-outside.md +143 -0
- package/docs/src/docs/_getting-started/create-a-component.md +137 -0
- package/docs/src/docs/_getting-started/my-first-subscriber.md +174 -0
- package/docs/src/docs/_getting-started/pubsub.md +150 -0
- package/docs/src/docs/_getting-started/start.md +39 -0
- package/docs/src/docs/_getting-started/theming.md +91 -0
- package/docs/src/docs/search/docs-search.json +3902 -0
- package/docs/src/tag-list.json +1 -0
- package/docs/src/tsconfig-model.json +23 -0
- package/docs/src/tsconfig.json +835 -0
- package/docs/svg/regular/plane.svg +1 -0
- package/docs/svg/solid/plane.svg +1 -0
- package/index.html +0 -0
- package/package.json +1 -1
- package/php/get-challenge.php +34 -0
- package/php/some-service.php +42 -0
- package/scripts/create-search.js +0 -0
- package/src/core/components/functional/date/date.ts +0 -0
- package/src/core/components/functional/functional.ts +0 -0
- package/src/core/components/functional/list/list.ts +72 -2
- package/src/core/components/functional/queue/queue.ts +19 -11
- package/src/core/components/functional/submit/submit.ts +0 -0
- package/src/core/components/functional/translation/translation.ts +0 -0
- package/src/core/components/ui/_css/scroll.ts +0 -0
- package/src/core/components/ui/_css/shadow.ts +0 -0
- package/src/core/components/ui/_css/size.ts +0 -0
- package/src/core/components/ui/_css/type.ts +0 -0
- package/src/core/components/ui/alert/alert.ts +0 -0
- package/src/core/components/ui/alert-messages/alert-messages.md +0 -0
- package/src/core/components/ui/button/button.ts +0 -0
- package/src/core/components/ui/captcha/captcha.md +0 -0
- package/src/core/components/ui/card/card-footer.ts +0 -0
- package/src/core/components/ui/card/card-header-descripton.ts +0 -0
- package/src/core/components/ui/card/card-header.ts +0 -0
- package/src/core/components/ui/card/card-main.ts +0 -0
- package/src/core/components/ui/card/card.md +0 -0
- package/src/core/components/ui/card/card.ts +0 -0
- package/src/core/components/ui/divider/divider.ts +0 -0
- package/src/core/components/ui/form/checkbox/checkbox.ts +0 -0
- package/src/core/components/ui/form/css/form-control.ts +8 -0
- package/src/core/components/ui/form/fieldset/legend-description.ts +0 -0
- package/src/core/components/ui/form/fieldset/legend.ts +0 -0
- package/src/core/components/ui/form/input/input.md +0 -0
- package/src/core/components/ui/form/input/input.ts +7 -0
- package/src/core/components/ui/form/input-autocomplete/input-autocomplete.ts +0 -0
- package/src/core/components/ui/form/radio/radio.ts +0 -0
- package/src/core/components/ui/form/select/select.ts +0 -0
- package/src/core/components/ui/form/switch/switch.md +0 -0
- package/src/core/components/ui/form/textarea/textarea.ts +0 -0
- package/src/core/components/ui/icon/icons.ts +0 -0
- package/src/core/components/ui/loader/loader.md +0 -0
- package/src/core/components/ui/loader/loader.ts +0 -0
- package/src/core/components/ui/loader/styles/fixed.ts +0 -0
- package/src/core/components/ui/loader/styles/inline.ts +0 -0
- package/src/core/components/ui/modal/modal-actions.ts +0 -0
- package/src/core/components/ui/modal/modal-subtitle.ts +0 -0
- package/src/core/components/ui/modal/modal-title.ts +0 -0
- package/src/core/components/ui/modal/modal.md +0 -0
- package/src/core/components/ui/modal/modal.ts +0 -0
- package/src/core/components/ui/pop/pop.ts +0 -0
- package/src/core/components/ui/progress/progress.ts +0 -0
- package/src/core/components/ui/table/table-tbody.ts +0 -0
- package/src/core/components/ui/table/table-th.ts +0 -0
- package/src/core/components/ui/table/table.ts +0 -0
- package/src/core/components/ui/theme/theme-collection/core-variables.ts +0 -0
- package/src/core/components/ui/theme/theme-collection/light.ts +0 -0
- package/src/core/components/ui/theme/theme.ts +0 -0
- package/src/core/components/ui/toast/toast-item.ts +0 -0
- package/src/core/components/ui/tooltip/tooltip.ts +0 -0
- package/src/core/components/ui/ui.ts +0 -0
- package/src/core/directives/DataProvider.ts +0 -0
- package/src/core/directives/Wording.ts +0 -0
- package/src/core/mixins/Fetcher.ts +30 -24
- package/src/core/mixins/FormElement.ts +0 -0
- package/src/core/mixins/Subscriber.ts +0 -0
- package/src/core/utils/Utils.ts +0 -0
- package/src/docs/header/header.ts +0 -0
- package/src/docs/layout.ts +0 -0
- package/src/docs/navigation/navigation.ts +0 -0
- package/src/docs/search/docs-search.json +0 -0
- package/src/docs/search/search.ts +0 -0
- package/src/docs/tailwind/css/tailwind.css +0 -0
- package/src/index.ts +0 -0
- package/tailwind.config.js +0 -0
- package/vite.config.mts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><!--! Font Awesome Pro 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M576 256C576 305 502.1 336 464.2 336H382.2L282.4 496C276.4 506 266.4 512 254.4 512H189.5C179.5 512 169.5 508 163.5 500C157.6 492 155.6 480.1 158.6 471L201.5 336H152.5L113.6 388C107.6 396 98.61 400 88.62 400H31.7C22.72 400 12.73 396 6.74 388C.7485 380-1.248 370 1.747 360L31.7 256L.7488 152C-1.248 143 .7488 133 6.74 125C12.73 117 22.72 112 31.7 112H88.62C98.61 112 107.6 117 113.6 125L152.5 176H201.5L158.6 41C155.6 32 157.6 21 163.5 13C169.5 5 179.5 0 189.5 0H254.4C265.4 0 277.4 7 281.4 16L381.2 176H463.2C502.1 176 576 208 576 256H576zM527.1 256C525.1 246 489.1 224 463.2 224H355.3L245.4 48H211.5L266.4 224H128.6L80.63 160H53.67L81.63 256L53.67 352H80.63L128.6 288H266.4L211.5 464H245.4L355.3 288H463.2C490.1 288 526.1 267 527.1 256V256z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><!--! Font Awesome Pro 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M482.3 192c34.2 0 93.7 29 93.7 64c0 36-59.5 64-93.7 64l-116.6 0L265.2 495.9c-5.7 10-16.3 16.1-27.8 16.1l-56.2 0c-10.6 0-18.3-10.2-15.4-20.4l49-171.6L112 320 68.8 377.6c-3 4-7.8 6.4-12.8 6.4l-42 0c-7.8 0-14-6.3-14-14c0-1.3 .2-2.6 .5-3.9L32 256 .5 145.9c-.4-1.3-.5-2.6-.5-3.9c0-7.8 6.3-14 14-14l42 0c5 0 9.8 2.4 12.8 6.4L112 192l102.9 0-49-171.6C162.9 10.2 170.6 0 181.2 0l56.2 0c11.5 0 22.1 6.2 27.8 16.1L365.7 192l116.6 0z"/></svg>
|
package/index.html
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
/* *
|
|
3
|
+
* Call get-challenge on auto-hosted latcha service at https://altcha.supersoniks.org
|
|
4
|
+
* */
|
|
5
|
+
|
|
6
|
+
// Autoriser toutes les origines
|
|
7
|
+
header("Access-Control-Allow-Origin: *");
|
|
8
|
+
|
|
9
|
+
// Autoriser les méthodes HTTP spécifiques
|
|
10
|
+
header("Access-Control-Allow-Methods: GET, POST, OPTIONS");
|
|
11
|
+
|
|
12
|
+
// Autoriser certains en-têtes spécifiques
|
|
13
|
+
header("Access-Control-Allow-Headers: Content-Type, Authorization");
|
|
14
|
+
|
|
15
|
+
// Si la méthode est OPTIONS, terminer la requête ici
|
|
16
|
+
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
|
|
17
|
+
http_response_code(200);
|
|
18
|
+
exit();
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function getChallenge($key){
|
|
22
|
+
$maxNumber=20000;
|
|
23
|
+
$queryString = $params = [
|
|
24
|
+
'key' => $key,
|
|
25
|
+
'maxNumber' => $maxNumber
|
|
26
|
+
];
|
|
27
|
+
// Générer la chaîne de requête
|
|
28
|
+
$queryString = http_build_query($params);
|
|
29
|
+
$url = "https://altcha.supersoniks.org/get-challenge?key=".$queryString;
|
|
30
|
+
$response = file_get_contents($url);
|
|
31
|
+
return $response;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
echo getChallenge($_GET['key']);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
/* *
|
|
3
|
+
* Call verify-solution on auto-hosted latcha service at https://altcha.supersoniks.org
|
|
4
|
+
* */
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
// Autoriser toutes les origines
|
|
8
|
+
header("Access-Control-Allow-Origin: *");
|
|
9
|
+
|
|
10
|
+
// Autoriser les méthodes HTTP spécifiques
|
|
11
|
+
header("Access-Control-Allow-Methods: GET, POST, OPTIONS");
|
|
12
|
+
|
|
13
|
+
// Autoriser certains en-têtes spécifiques
|
|
14
|
+
header("Access-Control-Allow-Headers: Content-Type, Authorization, x-altcha-spam-filter");
|
|
15
|
+
|
|
16
|
+
// Si la méthode est OPTIONS, terminer la requête ici
|
|
17
|
+
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
|
|
18
|
+
http_response_code(200);
|
|
19
|
+
exit();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function verifySolution($key, $solution){
|
|
23
|
+
$queryString = $params = [
|
|
24
|
+
'key' => $key,
|
|
25
|
+
'altcha' => $solution
|
|
26
|
+
];
|
|
27
|
+
// Générer la chaîne de requête
|
|
28
|
+
$queryString = http_build_query($params);
|
|
29
|
+
$url = "https://altcha.supersoniks.org/verify-solution?".$queryString;
|
|
30
|
+
$response = file_get_contents($url);
|
|
31
|
+
return $response;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Get json posted data
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
// Get the posted data
|
|
39
|
+
|
|
40
|
+
$data = json_decode(file_get_contents("php://input"));
|
|
41
|
+
|
|
42
|
+
echo verifySolution($data->captchakey, $data->captchatoken);
|
package/scripts/create-search.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { html, LitElement, nothing } from "lit";
|
|
1
|
+
import { html, LitElement, nothing, PropertyValues } from "lit";
|
|
2
2
|
import { customElement, property } from "lit/decorators.js";
|
|
3
3
|
import Subscriber from "@supersoniks/concorde/core/mixins/Subscriber";
|
|
4
4
|
import Fetcher from "@supersoniks/concorde/core/mixins/Fetcher";
|
|
@@ -70,6 +70,7 @@ export class List extends Fetcher(Subscriber(TemplatesContainer(LitElement))) {
|
|
|
70
70
|
if (this.isFetchEnabled) this.isLoading = true;
|
|
71
71
|
super.connectedCallback();
|
|
72
72
|
}
|
|
73
|
+
|
|
73
74
|
disconnectedCallback(): void {
|
|
74
75
|
super.disconnectedCallback();
|
|
75
76
|
}
|
|
@@ -91,7 +92,7 @@ export class List extends Fetcher(Subscriber(TemplatesContainer(LitElement))) {
|
|
|
91
92
|
renderLoadingState():
|
|
92
93
|
| DirectiveResult<typeof TemplateContentDirective>
|
|
93
94
|
| TemplateResult {
|
|
94
|
-
return html`${this.renderSkeleton()} ${this.renderLoader()}`;
|
|
95
|
+
return html`${this.renderSkeleton()} ${this.renderLoader()} `;
|
|
95
96
|
}
|
|
96
97
|
renderNoResultState() {
|
|
97
98
|
return html` <div
|
|
@@ -136,8 +137,77 @@ export class List extends Fetcher(Subscriber(TemplatesContainer(LitElement))) {
|
|
|
136
137
|
if (response) props._sonic_http_response_ = response;
|
|
137
138
|
return props;
|
|
138
139
|
}
|
|
140
|
+
protected updated(_changedProperties: PropertyValues): void {
|
|
141
|
+
window.requestAnimationFrame(() => {
|
|
142
|
+
if (!this.isLoading) {
|
|
143
|
+
this.style.setProperty("--list-loader-height-display", "none");
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
this.style.setProperty("--list-loader-height-display", "block");
|
|
148
|
+
this.loadingSize = this.getDisplayContentsSize(this);
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
super.updated(_changedProperties);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
getAllRenderableElements(root: any) {
|
|
155
|
+
let elements: any[] = [];
|
|
156
|
+
|
|
157
|
+
function collectElements(node: any) {
|
|
158
|
+
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
159
|
+
// Vérifier si l'élément a une boîte de rendu
|
|
160
|
+
const rect = node.getBoundingClientRect();
|
|
161
|
+
if (rect.width > 0 || rect.height > 0) {
|
|
162
|
+
elements.push(node);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// Parcourir les enfants
|
|
166
|
+
node.childNodes.forEach(collectElements);
|
|
139
167
|
|
|
168
|
+
// Vérifier le Shadow DOM
|
|
169
|
+
if (node.shadowRoot) {
|
|
170
|
+
node.shadowRoot.childNodes.forEach(collectElements);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
collectElements(root);
|
|
176
|
+
return elements;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
getDisplayContentsSize(element: any) {
|
|
180
|
+
const elements = this.getAllRenderableElements(element);
|
|
181
|
+
|
|
182
|
+
if (elements.length === 0) return { width: 0, height: 0 };
|
|
183
|
+
|
|
184
|
+
const rects = elements.map((el) => el.getBoundingClientRect());
|
|
185
|
+
|
|
186
|
+
const minX = Math.min(...rects.map((r) => r.left));
|
|
187
|
+
const maxX = Math.max(...rects.map((r) => r.right));
|
|
188
|
+
const minY = Math.min(...rects.map((r) => r.top));
|
|
189
|
+
const maxY = Math.max(...rects.map((r) => r.bottom));
|
|
190
|
+
|
|
191
|
+
return { width: maxX - minX, height: maxY - minY };
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* loadingsize is computed after rendering a loading / doesnt require one but will be used on other renderings
|
|
196
|
+
*/
|
|
197
|
+
loadingSize = { width: 0, height: 0 };
|
|
140
198
|
render() {
|
|
199
|
+
return html`
|
|
200
|
+
${this.renderContent()}
|
|
201
|
+
<div
|
|
202
|
+
style="grid-column: 1 / -1;min-height:${this.isLoading
|
|
203
|
+
? 0
|
|
204
|
+
: this.loadingSize
|
|
205
|
+
.height}px; width:0;float:left;display: var(--list-loader-height-display);"
|
|
206
|
+
></div>
|
|
207
|
+
`;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
renderContent() {
|
|
141
211
|
/**
|
|
142
212
|
* Loading
|
|
143
213
|
*/
|
|
@@ -171,7 +171,6 @@ export default class Queue extends Subscriber(LitElement, {} as QueueProps) {
|
|
|
171
171
|
clearTimeout(this.filterTimeoutId);
|
|
172
172
|
this.filterTimeoutId = setTimeout(
|
|
173
173
|
async () => {
|
|
174
|
-
this.storeScrollPosition();
|
|
175
174
|
const count = this.resultCount;
|
|
176
175
|
this.props = null;
|
|
177
176
|
//On garde le décompte au cas ou il n'y aurait pas rechargement
|
|
@@ -186,26 +185,35 @@ export default class Queue extends Subscriber(LitElement, {} as QueueProps) {
|
|
|
186
185
|
};
|
|
187
186
|
|
|
188
187
|
storeScrollPosition() {
|
|
188
|
+
if (!this.isSafari()) {
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
189
191
|
this.storedScrollX = window.scrollX;
|
|
190
192
|
this.storedScrollY = window.scrollY;
|
|
191
193
|
}
|
|
192
194
|
|
|
195
|
+
isSafari() {
|
|
196
|
+
return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
197
|
+
}
|
|
198
|
+
|
|
193
199
|
protected updated(_changedProperties: PropertyValues): void {
|
|
194
|
-
if (
|
|
195
|
-
Math.abs(this.storedScrollX - window.scrollX) > 10 ||
|
|
196
|
-
Math.abs(this.storedScrollY - window.scrollY) > 10
|
|
197
|
-
) {
|
|
198
|
-
window.scrollTo(this.storedScrollX, this.storedScrollY);
|
|
199
|
-
}
|
|
200
|
-
//Hack pour éviter que le scroll ne retourne en haut si safari
|
|
201
|
-
window.requestAnimationFrame(() => {
|
|
200
|
+
if (this.isSafari()) {
|
|
202
201
|
if (
|
|
203
202
|
Math.abs(this.storedScrollX - window.scrollX) > 10 ||
|
|
204
203
|
Math.abs(this.storedScrollY - window.scrollY) > 10
|
|
205
204
|
) {
|
|
206
205
|
window.scrollTo(this.storedScrollX, this.storedScrollY);
|
|
207
206
|
}
|
|
208
|
-
|
|
207
|
+
//Hack pour éviter que le scroll ne retourne en haut si safari
|
|
208
|
+
window.requestAnimationFrame(() => {
|
|
209
|
+
if (
|
|
210
|
+
Math.abs(this.storedScrollX - window.scrollX) > 10 ||
|
|
211
|
+
Math.abs(this.storedScrollY - window.scrollY) > 10
|
|
212
|
+
) {
|
|
213
|
+
window.scrollTo(this.storedScrollX, this.storedScrollY);
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
}
|
|
209
217
|
|
|
210
218
|
super.updated(_changedProperties);
|
|
211
219
|
}
|
|
@@ -318,10 +326,10 @@ export default class Queue extends Subscriber(LitElement, {} as QueueProps) {
|
|
|
318
326
|
storedScrollX = 0;
|
|
319
327
|
|
|
320
328
|
render() {
|
|
329
|
+
this.storeScrollPosition();
|
|
321
330
|
if (!Array.isArray(this.props)) {
|
|
322
331
|
return nothing;
|
|
323
332
|
}
|
|
324
|
-
this.storeScrollPosition();
|
|
325
333
|
|
|
326
334
|
let lazyload = !this.noLazyload;
|
|
327
335
|
if (this.props.length == 1) {
|
|
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
|
|
@@ -287,6 +287,14 @@ export const formControl = css`
|
|
|
287
287
|
:host([touched][required]) :not(:focus):valid + .select-chevron {
|
|
288
288
|
--sc-input-c: var(--sc-success, var(--sc-base-content, #000));
|
|
289
289
|
}
|
|
290
|
+
/*active*/
|
|
291
|
+
:host([active]) {
|
|
292
|
+
--sc-input-b-color: var(--sc-primary, var(--sc-base-content, #000));
|
|
293
|
+
--sc-input-c: var(--sc-primary, var(--sc-base-content, #000));
|
|
294
|
+
}
|
|
295
|
+
:host([active]) .select-chevron {
|
|
296
|
+
--sc-input-c: var(--sc-primary, var(--sc-base-content, #000));
|
|
297
|
+
}
|
|
290
298
|
|
|
291
299
|
/*Input COLOR*/
|
|
292
300
|
:host([type="color"]) .form-element {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -78,6 +78,9 @@ export class Input extends FormInput(FormElement(Subscriber(LitElement))) {
|
|
|
78
78
|
@property({ type: Boolean }) disableInlineContentFocus = false;
|
|
79
79
|
@property({ type: Boolean }) showPasswordToggle = false;
|
|
80
80
|
|
|
81
|
+
@property({ type: Boolean }) autoActive = false;
|
|
82
|
+
@property({ type: Boolean, reflect: true }) active = false;
|
|
83
|
+
|
|
81
84
|
@queryAssignedNodes({ slot: "label", flatten: true })
|
|
82
85
|
slotLabelNodes!: Array<Node>;
|
|
83
86
|
|
|
@@ -133,6 +136,10 @@ export class Input extends FormInput(FormElement(Subscriber(LitElement))) {
|
|
|
133
136
|
|
|
134
137
|
willUpdate(changedProperties: PropertyValues) {
|
|
135
138
|
this.hasSlotOrProps();
|
|
139
|
+
if (this.autoActive && changedProperties.has("value")) {
|
|
140
|
+
this.active = !!this.value;
|
|
141
|
+
}
|
|
142
|
+
|
|
136
143
|
super.willUpdate(changedProperties);
|
|
137
144
|
}
|
|
138
145
|
|
|
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
|
|
@@ -39,20 +39,19 @@ const dispatchFetchError = (apiResponse: Response) => {
|
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
const fetchComponents = new Set<{_fetchData:()=>void}>();
|
|
42
|
+
const fetchComponents = new Set<{ _fetchData: () => void }>();
|
|
43
43
|
let languageChangeRequestId = 0;
|
|
44
|
-
detecHTMLLanguageChange(async ()=>{
|
|
44
|
+
detecHTMLLanguageChange(async () => {
|
|
45
45
|
//relaunch 4 fetchs then wait the result before launching the next 4 fetchs
|
|
46
46
|
languageChangeRequestId++;
|
|
47
47
|
const currentRequestId = languageChangeRequestId;
|
|
48
48
|
const fetchers = Array.from(fetchComponents);
|
|
49
|
-
while(fetchers.length>0){
|
|
50
|
-
if(currentRequestId!=languageChangeRequestId) return;
|
|
51
|
-
const fourFetchers = fetchers.splice(0,4);
|
|
52
|
-
await Promise.all(fourFetchers.map((fetcher)=>fetcher._fetchData()));
|
|
49
|
+
while (fetchers.length > 0) {
|
|
50
|
+
if (currentRequestId != languageChangeRequestId) return;
|
|
51
|
+
const fourFetchers = fetchers.splice(0, 4);
|
|
52
|
+
await Promise.all(fourFetchers.map((fetcher) => fetcher._fetchData()));
|
|
53
53
|
}
|
|
54
|
-
}
|
|
55
|
-
);
|
|
54
|
+
});
|
|
56
55
|
|
|
57
56
|
const Fetcher = <
|
|
58
57
|
T extends Constructor<SubscriberInterface<PropsType>>,
|
|
@@ -63,7 +62,6 @@ const Fetcher = <
|
|
|
63
62
|
) => {
|
|
64
63
|
propsType;
|
|
65
64
|
class FetcherElement extends superClass {
|
|
66
|
-
|
|
67
65
|
api: API | null = null;
|
|
68
66
|
/**
|
|
69
67
|
* Après le chargement des données on traverse l'objet reçu en fonctione de la cible exprimées dans cette propriété avec la dot syntaxe.
|
|
@@ -259,21 +257,26 @@ const Fetcher = <
|
|
|
259
257
|
/**
|
|
260
258
|
* Première update, le comportement de lazyload est géré ici a l'aide d'un intersection observer.
|
|
261
259
|
*/
|
|
262
|
-
|
|
260
|
+
lazyLoadPlaceHolder?: HTMLSpanElement;
|
|
263
261
|
handleLazyLoad() {
|
|
264
262
|
if (!this.lazyLoad) {
|
|
265
263
|
return;
|
|
266
264
|
}
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
265
|
+
/**
|
|
266
|
+
* Should not be required
|
|
267
|
+
* Todo : remove after success
|
|
268
|
+
* creates forced reflow
|
|
269
|
+
*/
|
|
270
|
+
// const rect = this.getBoundingClientRect();
|
|
271
|
+
// if (
|
|
272
|
+
// rect.x < window.innerWidth &&
|
|
273
|
+
// rect.right > 0 &&
|
|
274
|
+
// rect.y < window.innerHeight &&
|
|
275
|
+
// rect.right > 0
|
|
276
|
+
// ) {
|
|
277
|
+
// this._fetchData();
|
|
278
|
+
// return;
|
|
279
|
+
// }
|
|
277
280
|
|
|
278
281
|
const boundsRatio = parseFloat(
|
|
279
282
|
this.getAttribute("lazyBoundsRatio") || "1"
|
|
@@ -302,14 +305,17 @@ const Fetcher = <
|
|
|
302
305
|
(e) => e.nodeName.toLowerCase() != "style"
|
|
303
306
|
)[0] as HTMLElement;
|
|
304
307
|
if (!elt || elt.nodeName.toLocaleLowerCase() == "template") {
|
|
305
|
-
elt = document.createElement("
|
|
308
|
+
elt = document.createElement("div");
|
|
306
309
|
const style = elt.style;
|
|
307
310
|
/**
|
|
308
311
|
* !!! Pas de position absolute ici si on veut que le composant soit au bon endroit dans la page pour l'intersection observer
|
|
309
312
|
* En effest sinon il vpeut remonter en congugaison avec le style display="contents"
|
|
310
313
|
*/
|
|
311
314
|
style.pointerEvents = "none";
|
|
312
|
-
|
|
315
|
+
style.width = "1px";
|
|
316
|
+
style.height = "1px";
|
|
317
|
+
this.lazyLoadPlaceHolder = elt;
|
|
318
|
+
|
|
313
319
|
this.appendChild(elt);
|
|
314
320
|
}
|
|
315
321
|
if (elt) {
|
|
@@ -322,8 +328,8 @@ const Fetcher = <
|
|
|
322
328
|
for (const e of entries) {
|
|
323
329
|
if (e.isIntersecting && this.isFirstLoad) {
|
|
324
330
|
this._fetchData();
|
|
325
|
-
this.
|
|
326
|
-
this.
|
|
331
|
+
this.lazyLoadPlaceHolder?.remove();
|
|
332
|
+
this.lazyLoadPlaceHolder = undefined;
|
|
327
333
|
this.iObserver?.disconnect();
|
|
328
334
|
break;
|
|
329
335
|
}
|
|
File without changes
|
|
File without changes
|
package/src/core/utils/Utils.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/src/docs/layout.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/index.ts
CHANGED
|
File without changes
|
package/tailwind.config.js
CHANGED
|
File without changes
|
package/vite.config.mts
CHANGED
|
File without changes
|