@supersoniks/concorde 3.1.43 → 3.1.45

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.
Files changed (149) hide show
  1. package/build-infos.json +1 -1
  2. package/concorde-core.bundle.js +238 -253
  3. package/concorde-core.es.js +3096 -3222
  4. package/dist/concorde-core.bundle.js +238 -253
  5. package/dist/concorde-core.es.js +3096 -3222
  6. package/docs/assets/index-CnxgssIs.js +4433 -0
  7. package/docs/assets/index-DCqvoAAf.css +1 -0
  8. package/docs/css/docs.css +0 -0
  9. package/docs/fonts/ClashGrotesk-Bold.eot +0 -0
  10. package/docs/fonts/ClashGrotesk-Bold.ttf +0 -0
  11. package/docs/fonts/ClashGrotesk-Bold.woff +0 -0
  12. package/docs/fonts/ClashGrotesk-Bold.woff2 +0 -0
  13. package/docs/fonts/ClashGrotesk-Extralight.eot +0 -0
  14. package/docs/fonts/ClashGrotesk-Extralight.ttf +0 -0
  15. package/docs/fonts/ClashGrotesk-Extralight.woff +0 -0
  16. package/docs/fonts/ClashGrotesk-Extralight.woff2 +0 -0
  17. package/docs/fonts/ClashGrotesk-Light.eot +0 -0
  18. package/docs/fonts/ClashGrotesk-Light.ttf +0 -0
  19. package/docs/fonts/ClashGrotesk-Light.woff +0 -0
  20. package/docs/fonts/ClashGrotesk-Light.woff2 +0 -0
  21. package/docs/fonts/ClashGrotesk-Medium.eot +0 -0
  22. package/docs/fonts/ClashGrotesk-Medium.ttf +0 -0
  23. package/docs/fonts/ClashGrotesk-Medium.woff +0 -0
  24. package/docs/fonts/ClashGrotesk-Medium.woff2 +0 -0
  25. package/docs/fonts/ClashGrotesk-Regular.eot +0 -0
  26. package/docs/fonts/ClashGrotesk-Regular.ttf +0 -0
  27. package/docs/fonts/ClashGrotesk-Regular.woff +0 -0
  28. package/docs/fonts/ClashGrotesk-Regular.woff2 +0 -0
  29. package/docs/fonts/ClashGrotesk-Semibold.eot +0 -0
  30. package/docs/fonts/ClashGrotesk-Semibold.ttf +0 -0
  31. package/docs/fonts/ClashGrotesk-Semibold.woff +0 -0
  32. package/docs/fonts/ClashGrotesk-Semibold.woff2 +0 -0
  33. package/docs/fonts/ClashGrotesk-Variable.eot +0 -0
  34. package/docs/fonts/ClashGrotesk-Variable.ttf +0 -0
  35. package/docs/fonts/ClashGrotesk-Variable.woff +0 -0
  36. package/docs/fonts/ClashGrotesk-Variable.woff2 +0 -0
  37. package/docs/img/concorde-icon.svg +5 -0
  38. package/docs/img/concorde-logo.svg +1 -0
  39. package/docs/img/concorde.png +0 -0
  40. package/docs/img/concorde_def.png +0 -0
  41. package/docs/img/concorde_seuil.png.webp +0 -0
  42. package/docs/img/concorde_seuil_invert.png +0 -0
  43. package/docs/img/paul_metrand.jpg +0 -0
  44. package/docs/img/paul_metrand_xs.jpg +0 -0
  45. package/docs/index.html +93 -0
  46. package/docs/src/core/components/functional/date/date.md +290 -0
  47. package/docs/src/core/components/functional/fetch/fetch.md +117 -0
  48. package/docs/src/core/components/functional/if/if.md +16 -0
  49. package/docs/src/core/components/functional/list/list.md +199 -0
  50. package/docs/src/core/components/functional/mix/mix.md +41 -0
  51. package/docs/src/core/components/functional/queue/queue.md +87 -0
  52. package/docs/src/core/components/functional/router/router.md +112 -0
  53. package/docs/src/core/components/functional/sdui/default-library.json +108 -0
  54. package/docs/src/core/components/functional/sdui/example.json +99 -0
  55. package/docs/src/core/components/functional/sdui/sdui.md +356 -0
  56. package/docs/src/core/components/functional/states/states.md +87 -0
  57. package/docs/src/core/components/functional/submit/submit.md +83 -0
  58. package/docs/src/core/components/functional/subscriber/subscriber.md +91 -0
  59. package/docs/src/core/components/functional/value/value.md +35 -0
  60. package/docs/src/core/components/ui/alert/alert.md +121 -0
  61. package/docs/src/core/components/ui/badge/badge.md +102 -0
  62. package/docs/src/core/components/ui/button/button.md +184 -0
  63. package/docs/src/core/components/ui/captcha/captcha.md +12 -0
  64. package/docs/src/core/components/ui/card/card.md +96 -0
  65. package/docs/src/core/components/ui/divider/divider.md +35 -0
  66. package/docs/src/core/components/ui/form/checkbox/checkbox.md +96 -0
  67. package/docs/src/core/components/ui/form/fieldset/fieldset.md +129 -0
  68. package/docs/src/core/components/ui/form/form-actions/form-actions.md +77 -0
  69. package/docs/src/core/components/ui/form/form-layout/form-layout.md +43 -0
  70. package/docs/src/core/components/ui/form/input/input.md +168 -0
  71. package/docs/src/core/components/ui/form/input-autocomplete/input-autocomplete.md +130 -0
  72. package/docs/src/core/components/ui/form/radio/radio.md +86 -0
  73. package/docs/src/core/components/ui/form/select/select.md +99 -0
  74. package/docs/src/core/components/ui/form/textarea/textarea.md +65 -0
  75. package/docs/src/core/components/ui/group/group.md +75 -0
  76. package/docs/src/core/components/ui/icon/icon.md +125 -0
  77. package/docs/src/core/components/ui/icon/icons.json +1 -0
  78. package/docs/src/core/components/ui/image/image.md +107 -0
  79. package/docs/src/core/components/ui/link/link.md +43 -0
  80. package/docs/src/core/components/ui/loader/loader.md +37 -0
  81. package/docs/src/core/components/ui/menu/menu.md +288 -0
  82. package/docs/src/core/components/ui/modal/modal.md +123 -0
  83. package/docs/src/core/components/ui/pop/pop.md +79 -0
  84. package/docs/src/core/components/ui/progress/progress.md +63 -0
  85. package/docs/src/core/components/ui/table/table.md +455 -0
  86. package/docs/src/core/components/ui/tooltip/tooltip.md +82 -0
  87. package/docs/src/docs/_core-concept/overview.md +57 -0
  88. package/docs/src/docs/_core-concept/subscriber.md +76 -0
  89. package/docs/src/docs/_getting-started/concorde-outside.md +143 -0
  90. package/docs/src/docs/_getting-started/create-a-component.md +137 -0
  91. package/docs/src/docs/_getting-started/my-first-subscriber.md +174 -0
  92. package/docs/src/docs/_getting-started/pubsub.md +150 -0
  93. package/docs/src/docs/_getting-started/start.md +39 -0
  94. package/docs/src/docs/_getting-started/theming.md +91 -0
  95. package/docs/src/docs/search/docs-search.json +3887 -0
  96. package/docs/src/tag-list.json +1 -0
  97. package/docs/src/tsconfig-model.json +23 -0
  98. package/docs/src/tsconfig.json +808 -0
  99. package/docs/svg/regular/plane.svg +1 -0
  100. package/docs/svg/solid/plane.svg +1 -0
  101. package/index.html +0 -0
  102. package/package.json +1 -1
  103. package/scripts/pre-build.mjs +0 -0
  104. package/scripts/pre-publish.mjs +0 -0
  105. package/src/core/_types/types.ts +0 -0
  106. package/src/core/components/functional/queue/queue.ts +22 -15
  107. package/src/core/components/functional/router/router.md +0 -0
  108. package/src/core/components/functional/router/router.ts +0 -0
  109. package/src/core/components/functional/sonic-scope/sonic-scope.ts +0 -0
  110. package/src/core/components/functional/states/states.md +0 -0
  111. package/src/core/components/functional/states/states.ts +0 -0
  112. package/src/core/components/functional/submit/submit.md +0 -0
  113. package/src/core/components/functional/submit/submit.ts +0 -0
  114. package/src/core/components/functional/translation/translation.ts +2 -1
  115. package/src/core/components/ui/alert/alert.md +0 -0
  116. package/src/core/components/ui/alert-messages/alert-messages.ts +0 -0
  117. package/src/core/components/ui/badge/badge.md +0 -0
  118. package/src/core/components/ui/form/checkbox/checkbox.md +0 -0
  119. package/src/core/components/ui/form/fieldset/fieldset.ts +0 -0
  120. package/src/core/components/ui/form/input/password-helper.ts +0 -0
  121. package/src/core/components/ui/form/input/same-value-helper.ts +0 -0
  122. package/src/core/components/ui/form/input-autocomplete/input-autocomplete.ts +14 -1
  123. package/src/core/components/ui/form/radio/radio.md +0 -0
  124. package/src/core/components/ui/form/select/select.md +0 -0
  125. package/src/core/components/ui/group/group.ts +0 -0
  126. package/src/core/components/ui/image/image.ts +0 -0
  127. package/src/core/components/ui/menu/menu.ts +0 -0
  128. package/src/core/components/ui/modal/modal.md +0 -0
  129. package/src/core/components/ui/theme/theme-collection/dark.ts +0 -0
  130. package/src/core/components/ui/toast/message-subscriber.ts +0 -0
  131. package/src/core/components/ui/toast/toast.ts +0 -0
  132. package/src/core/components/ui/ui.ts +0 -0
  133. package/src/core/core.ts +0 -0
  134. package/src/core/directives/DataProvider.ts +1 -1
  135. package/src/core/mixins/FormCheckable.ts +0 -0
  136. package/src/core/mixins/FormElement.ts +2 -2
  137. package/src/core/mixins/Subscriber.ts +0 -0
  138. package/src/core/utils/HTML.ts +0 -0
  139. package/src/core/utils/LocationHandler.ts +0 -0
  140. package/src/core/utils/Objects.ts +0 -0
  141. package/src/core/utils/PublisherProxy.ts +0 -0
  142. package/src/core/utils/Utils.ts +5 -5
  143. package/src/core/utils/api.ts +46 -0
  144. package/src/core/utils/route.ts +0 -0
  145. package/src/docs/docs.ts +0 -0
  146. package/src/docs/search/docs-search.json +0 -0
  147. package/src/docs/search/page.ts +0 -0
  148. package/src/tsconfig-model.json +0 -0
  149. package/vite/config.js +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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supersoniks/concorde",
3
- "version": "3.1.43",
3
+ "version": "3.1.45",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "",
File without changes
File without changes
File without changes
@@ -79,7 +79,6 @@ export default class Queue extends Subscriber(LitElement, {} as QueueProps) {
79
79
  instanceId = 0;
80
80
  localStorage = "disabled";
81
81
 
82
-
83
82
  async connectedCallback() {
84
83
  this.instanceId = Queue.instanceCounter++;
85
84
  this.localStorage = this.getAttribute("localStorage") || this.localStorage;
@@ -103,6 +102,7 @@ export default class Queue extends Subscriber(LitElement, {} as QueueProps) {
103
102
  HTML.getAncestorAttributeValue(this.parentElement, "dataProvider") ||
104
103
  "";
105
104
  }
105
+ this.storeScrollPosition();
106
106
  super.connectedCallback();
107
107
  this.publisher.set({});
108
108
  this.key = this.getAttribute("key");
@@ -171,6 +171,7 @@ 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();
174
175
  const count = this.resultCount;
175
176
  this.props = null;
176
177
  //On garde le décompte au cas ou il n'y aurait pas rechargement
@@ -184,23 +185,31 @@ export default class Queue extends Subscriber(LitElement, {} as QueueProps) {
184
185
  this.isFirstRequest = false;
185
186
  };
186
187
 
188
+ storeScrollPosition() {
189
+ this.storedScrollX = window.scrollX;
190
+ this.storedScrollY = window.scrollY;
191
+ }
192
+
187
193
  protected updated(_changedProperties: PropertyValues): void {
188
-
189
- if(Math.abs(this.scrollX - window.scrollX) > 10 || Math.abs(this.scrollY - window.scrollY) > 10){
190
- window.scrollTo(this.scrollX, this.scrollY);
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);
191
199
  }
192
200
  //Hack pour éviter que le scroll ne retourne en haut si safari
193
- window.requestAnimationFrame(() => {
194
- if(Math.abs(this.scrollX - window.scrollX) > 10 || Math.abs(this.scrollY - window.scrollY) > 10){
195
- window.scrollTo(this.scrollX, this.scrollY);
201
+ window.requestAnimationFrame(() => {
202
+ if (
203
+ Math.abs(this.storedScrollX - window.scrollX) > 10 ||
204
+ Math.abs(this.storedScrollY - window.scrollY) > 10
205
+ ) {
206
+ window.scrollTo(this.storedScrollX, this.storedScrollY);
196
207
  }
197
208
  });
198
209
 
199
210
  super.updated(_changedProperties);
200
211
  }
201
212
 
202
-
203
-
204
213
  /**
205
214
  * Cette expression est utilisée comme modèle par le composant Queue pour renseigngner le dataProvider de la [liste](./?path=/docs/core-components-functional-list-list--basic) créée.
206
215
  * * l'expression *$offset* est alors remplacée par le numéro de l'élément à partir duquel démarrer
@@ -305,16 +314,14 @@ export default class Queue extends Subscriber(LitElement, {} as QueueProps) {
305
314
  this.lastRequestTime = new Date().getTime();
306
315
  }
307
316
 
308
- scrollY = 0;
309
- scrollX = 0;
317
+ storedScrollY = 0;
318
+ storedScrollX = 0;
310
319
 
311
320
  render() {
312
- if (!Array.isArray(this.props)){
321
+ if (!Array.isArray(this.props)) {
313
322
  return nothing;
314
323
  }
315
-
316
- this.scrollX = window.scrollX;
317
- this.scrollY = window.scrollY;
324
+ this.storeScrollPosition();
318
325
 
319
326
  let lazyload = !this.noLazyload;
320
327
  if (this.props.length == 1) {
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -5,8 +5,9 @@ const tagName = "sonic-t";
5
5
  @customElement(tagName)
6
6
  export class SonicT extends LitElement {
7
7
  @property({ type: String }) key?: string;
8
+ @property({ type: Boolean }) unsafeHTML?: boolean;
8
9
  render() {
9
10
  if (!this.key) return nothing;
10
- return html`${t(this.key)}`;
11
+ return html`${t(this.key, this.unsafeHTML)}`;
11
12
  }
12
13
  }
File without changes
File without changes
File without changes
File without changes
@@ -23,6 +23,7 @@ import { Input } from "@supersoniks/concorde/core/components/ui/form/input/input
23
23
  import { customScroll } from "@supersoniks/concorde/core/components/ui/_css/scroll";
24
24
  import { ResizeController } from "@lit-labs/observers/resize-controller.js";
25
25
  import { traverseDotNotation } from "@supersoniks/concorde/core/utils/Objects";
26
+ import { FormElementValue } from "@supersoniks/concorde/core/mixins/FormElement";
26
27
 
27
28
  type ListItem = Record<string, string>;
28
29
 
@@ -41,7 +42,10 @@ export class InputAutocomplete extends TemplatesContainer(
41
42
  :host {
42
43
  display: block;
43
44
  }
44
-
45
+ /**disable mouse if there is an attribute readonly */
46
+ :host([readonly]) {
47
+ pointer-events: none;
48
+ }
45
49
  sonic-menu {
46
50
  display: block;
47
51
  max-height: clamp(12rem, 20vh, 20rem);
@@ -96,6 +100,15 @@ export class InputAutocomplete extends TemplatesContainer(
96
100
  this.hasInputPrefix = !!this.slotInputPrefixNodes?.length;
97
101
  }
98
102
 
103
+ override get value() {
104
+ return super.value;
105
+ }
106
+
107
+ override set value(value: FormElementValue) {
108
+ this.searchPublisher?.set(value);
109
+ super.value = value;
110
+ }
111
+
99
112
  /**
100
113
  * Run when the formDataProvider's field is updated
101
114
  *
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/src/core/core.ts CHANGED
File without changes
@@ -108,7 +108,7 @@ const deepee = (id: Observable, defaultValue?: any) => {
108
108
  value.set(defaultValue);
109
109
  }
110
110
  }
111
- return value || new Publisher({});
111
+ return value as any;
112
112
  };
113
113
 
114
114
  export const dataProvider = deepee;
File without changes
@@ -10,7 +10,7 @@ import {
10
10
  } from "../_types/types";
11
11
  import { MixinArgsType } from "../_types/types";
12
12
  type Constructor<T> = new (...args: MixinArgsType[]) => T;
13
- type FormElementValue = string | string[] | object | null | undefined;
13
+ export type FormElementValue = string | string[] | object | null | undefined;
14
14
  export interface FormElementInterface extends SubscriberInterface {
15
15
  getFormPublisher(): PublisherInterface;
16
16
  updateDataValue(): void;
@@ -309,7 +309,7 @@ const Form = <T extends Constructor<SubscriberInterface>>(superClass: T) => {
309
309
  this.formDataProvider = this.getAncestorAttributeValue(
310
310
  "formDataProvider"
311
311
  ) as string;
312
-
312
+
313
313
  super.connectedCallback();
314
314
  this.addKeyboardNavigation();
315
315
  }
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,7 +1,7 @@
1
1
  export default class Utils {
2
2
  static async queueTaskPromise() {
3
3
  return new Promise((resolve) => {
4
- window.queueMicrotask(()=>resolve(null));
4
+ window.queueMicrotask(() => resolve(null));
5
5
  });
6
6
  }
7
7
  static async delayPromise(timeoutMs: number) {
@@ -17,8 +17,8 @@ let SONIC_PREFIX = "sonic";
17
17
  if (typeof __SONIC_PREFIX__ !== "undefined") {
18
18
  SONIC_PREFIX = __SONIC_PREFIX__;
19
19
  }
20
- let prefixUpperCamelCase = SONIC_PREFIX.replace(
21
- /-([a-z])/g,
22
- (g) => g[1].toUpperCase()
20
+ let prefixUpperCamelCase = SONIC_PREFIX.replace(/-([a-z])/g, (g) =>
21
+ g[1].toUpperCase()
23
22
  );
24
- export const sonicClassPrefix = prefixUpperCamelCase.charAt(0).toUpperCase() + prefixUpperCamelCase.slice(1);
23
+ export const sonicClassPrefix =
24
+ prefixUpperCamelCase.charAt(0).toUpperCase() + prefixUpperCamelCase.slice(1);
@@ -535,3 +535,49 @@ class API {
535
535
  }
536
536
  }
537
537
  export default API;
538
+
539
+ /*
540
+ logs handling
541
+ */
542
+
543
+ let logIsConf = false;
544
+ let logEndPoint = "log";
545
+ let logConfiguration: APIConfiguration = HTML.getApiConfiguration(
546
+ document.body || document.documentElement
547
+ );
548
+
549
+ let logsToSend: any = [];
550
+ let logsSendId = 0;
551
+
552
+ export const log = async (message: string, variables?: any) => {
553
+ if (!logIsConf) {
554
+ return;
555
+ }
556
+ logsToSend.push({
557
+ message: message,
558
+ variables: variables ? variables : {},
559
+ });
560
+
561
+ logsSendId++;
562
+ const id = logsSendId;
563
+ window.queueMicrotask(() => {
564
+ if (id !== logsSendId) return;
565
+ const sendedLogs = [...logsToSend];
566
+ logsToSend = [];
567
+ const api = new API(logConfiguration);
568
+ return api.post(logEndPoint, { logs: sendedLogs });
569
+ });
570
+ };
571
+ let errorCount = 0;
572
+ export const configLog = (newConfig: APIConfiguration, endPoint = "log") => {
573
+ logEndPoint = endPoint;
574
+ logConfiguration = newConfig;
575
+ logIsConf = true;
576
+
577
+ window.addEventListener("error", (e) => {
578
+ if (errorCount > 3) return;
579
+ log(e.message, e);
580
+ errorCount++;
581
+ return false;
582
+ });
583
+ };
File without changes
package/src/docs/docs.ts CHANGED
File without changes
File without changes
File without changes
File without changes
package/vite/config.js CHANGED
File without changes