@supersoniks/concorde 3.1.50 → 3.1.53

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 (162) hide show
  1. package/build-infos.json +1 -1
  2. package/concorde-core.bundle.js +187 -121
  3. package/concorde-core.es.js +1294 -1207
  4. package/dist/concorde-core.bundle.js +187 -121
  5. package/dist/concorde-core.es.js +1294 -1207
  6. package/docs/assets/index-CcoMn1RV.js +4465 -0
  7. package/docs/assets/index-D0m8hkmQ.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 +108 -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 +127 -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 +97 -0
  65. package/docs/src/core/components/ui/divider/divider.md +35 -0
  66. package/docs/src/core/components/ui/form/checkbox/checkbox.md +94 -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 +167 -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 +84 -0
  73. package/docs/src/core/components/ui/form/select/select.md +97 -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 +67 -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 +826 -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 +4 -1
  103. package/scripts/pre-build.mjs +0 -0
  104. package/scripts/pre-publish.mjs +0 -0
  105. package/src/core/components/functional/if/if.md +1 -1
  106. package/src/core/components/functional/queue/queue.ts +0 -0
  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/ui/alert/alert.md +0 -0
  115. package/src/core/components/ui/alert-messages/alert-messages.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/button/button.md +0 -2
  119. package/src/core/components/ui/captcha/captcha.ts +0 -0
  120. package/src/core/components/ui/card/card.md +1 -1
  121. package/src/core/components/ui/divider/divider.ts +1 -1
  122. package/src/core/components/ui/form/checkbox/checkbox.md +0 -0
  123. package/src/core/components/ui/form/checkbox/checkbox.ts +1 -1
  124. package/src/core/components/ui/form/fieldset/fieldset.ts +0 -0
  125. package/src/core/components/ui/form/form-layout/form-layout.md +1 -0
  126. package/src/core/components/ui/form/input/input.ts +2 -0
  127. package/src/core/components/ui/form/input/password-helper.ts +0 -0
  128. package/src/core/components/ui/form/input/same-value-helper.ts +0 -0
  129. package/src/core/components/ui/form/radio/radio.md +0 -0
  130. package/src/core/components/ui/form/select/select.md +0 -0
  131. package/src/core/components/ui/form/switch/switch.md +84 -0
  132. package/src/core/components/ui/form/switch/switch.ts +77 -0
  133. package/src/core/components/ui/group/group.ts +0 -0
  134. package/src/core/components/ui/icon/icons.ts +0 -0
  135. package/src/core/components/ui/image/image.md +13 -13
  136. package/src/core/components/ui/image/image.ts +0 -0
  137. package/src/core/components/ui/menu/menu.ts +0 -0
  138. package/src/core/components/ui/modal/modal.md +2 -2
  139. package/src/core/components/ui/theme/theme-collection/dark.ts +0 -0
  140. package/src/core/components/ui/toast/message-subscriber.ts +0 -0
  141. package/src/core/components/ui/toast/toast.ts +0 -0
  142. package/src/core/components/ui/ui.ts +1 -0
  143. package/src/core/core.ts +0 -0
  144. package/src/core/mixins/FormCheckable.ts +0 -0
  145. package/src/core/mixins/Subscriber.ts +0 -0
  146. package/src/core/utils/HTML.ts +0 -0
  147. package/src/core/utils/LocationHandler.ts +0 -0
  148. package/src/core/utils/Objects.ts +0 -0
  149. package/src/core/utils/PublisherProxy.ts +51 -43
  150. package/src/core/utils/Utils.ts +0 -0
  151. package/src/core/utils/route.ts +0 -0
  152. package/src/docs/code.ts +2 -0
  153. package/src/docs/docs.ts +0 -0
  154. package/src/docs/header/header.ts +1 -1
  155. package/src/docs/navigation/navigation.ts +8 -0
  156. package/src/docs/search/docs-search.json +20 -5
  157. package/src/docs/search/markdown-renderer.ts +26 -8
  158. package/src/docs/search/page.ts +0 -0
  159. package/src/tsconfig-model.json +0 -0
  160. package/src/tsconfig.json +9 -0
  161. package/src/tsconfig.tsbuildinfo +1 -1
  162. package/vite/config.js +0 -0
@@ -16,11 +16,8 @@ type TemplateFillingListener = {
16
16
  propertyMap: Record<string, string>;
17
17
  } & DynamicFillingListener;
18
18
 
19
- function isLeaf(value:any){
20
- return Object.prototype.hasOwnProperty.call(
21
- value,
22
- "__value"
23
- );
19
+ function isLeaf(value: any) {
20
+ return Object.prototype.hasOwnProperty.call(value, "__value");
24
21
  }
25
22
 
26
23
  function isComplex(value: any) {
@@ -35,15 +32,11 @@ if (typeof __BUILD_DATE__ === "undefined") {
35
32
  (window as any).__BUILD_DATE__ = "No build date";
36
33
  }
37
34
 
38
-
39
35
  if (typeof __SONIC_PREFIX__ === "undefined") {
40
36
  SONIC_PREFIX = "sonic" + Math.floor(Math.random() * 1000000);
41
37
  }
42
38
  export const prefix = SONIC_PREFIX;
43
39
 
44
-
45
-
46
-
47
40
  const localStorageDataKey =
48
41
  SONIC_PREFIX == "sonic"
49
42
  ? "publisher-proxies-data"
@@ -58,6 +51,7 @@ export class PublisherProxy<T = any> {
58
51
  _proxies_: Map<string, PublisherProxy> = new Map();
59
52
  _value_: T;
60
53
  _is_savable_ = false;
54
+ _expiration_delay_ = 1000 * 60 * 60 * 12;
61
55
  _invalidateListeners_ = new Set<VoidFunction>();
62
56
  _formInvalidateListeners_ = new Set<VoidFunction>();
63
57
  _assignListeners_ = new Set<(value: T) => void>();
@@ -156,23 +150,17 @@ export class PublisherProxy<T = any> {
156
150
  );
157
151
  }
158
152
  _publishDynamicFilling_(key: string, value: CoreJSType) {
159
-
160
-
161
153
  this._fillListeners_.forEach((handler) => {
162
154
  if (handler[key] !== value) handler[key] = value;
163
155
  });
164
156
  this._publishTemplateFilling_(key, value);
165
157
  }
166
158
  _publishTemplateFilling_(key: string, value: CoreJSType) {
167
-
168
159
  this._templateFillListeners_.forEach((handler) => {
169
-
170
160
  const desc = Object.getOwnPropertyDescriptor(handler, key);
171
161
 
172
-
173
162
  if (desc && !desc.set && !desc.writable) return;
174
163
 
175
-
176
164
  if (handler.propertyMap && handler.propertyMap[key]) {
177
165
  key = handler.propertyMap[key];
178
166
  }
@@ -307,9 +295,8 @@ export class PublisherProxy<T = any> {
307
295
  set(newValue: T, lockInternalMutationsTransmission = false) {
308
296
  /**
309
297
  * On retounre tout de suite si la valeur n'a pas changé
310
- */
298
+ */
311
299
 
312
-
313
300
  if (this._value_ === newValue) return true;
314
301
 
315
302
  /**
@@ -330,13 +317,11 @@ export class PublisherProxy<T = any> {
330
317
  * On assigne la nouvelle valeur
331
318
  */
332
319
 
333
-
334
- /** Si la valeur est complexe on assigne newValue directe sinon on le met dans une sous valeur __value */
320
+ /** Si la valeur est complexe on assigne newValue directe sinon on le met dans une sous valeur __value */
335
321
  this._value_ = isComplex(newValue)
336
322
  ? newValue
337
323
  : ({ __value: newValue } as any);
338
324
  this._cachedGet_ = undefined;
339
-
340
325
 
341
326
  /**
342
327
  * Si il s'agit d'une valeur primitive (un entier, une chaine ) la valeure en renseignée par un objet contenant la vaeur {__value}
@@ -364,18 +349,17 @@ export class PublisherProxy<T = any> {
364
349
  this.parent._value_[this._parentKey_] = valueTosetInParent;
365
350
  }
366
351
  }
367
-
352
+
368
353
  if (isLeafNewValue) {
369
354
  //await //await here gives better performance but can cause issues with some listeners
370
355
  this._publishAssignement_(lockInternalMutationsTransmission);
371
- if (this.parent && this._parentKey_){
372
-
373
- this.parent._publishDynamicFilling_(
356
+ if (this.parent && this._parentKey_) {
357
+ this.parent._publishDynamicFilling_(
374
358
  this._parentKey_,
375
359
  (this._value_ as any).__value
376
360
  );
377
361
  }
378
-
362
+
379
363
  return true;
380
364
  }
381
365
  /**
@@ -384,28 +368,31 @@ export class PublisherProxy<T = any> {
384
368
  * On met à jour leur valeur interne
385
369
  * On publie les maj au fur et a mesure de modifications
386
370
  */
387
-
371
+
388
372
  for (const key in this._value_) {
389
373
  const currentValue = this._value_[key] as any;
390
374
  if (currentValue === undefined) delete this._value_[key];
391
- }
375
+ }
392
376
 
393
377
  this._proxies_.forEach((_subProxy, key) => {
394
378
  /**
395
- *
379
+ *
396
380
  * On reùmplace les undefined par des nuls pour eviter la suppression des clefs sauf pour les clef tableaux
397
381
  **/
398
- const currentValue:any = (this._value_ as any)[key] ;
399
-
400
- if (key != "_parent_") {
401
- if (currentValue === undefined && currentValue !== null && isNaN(Number(key))) {
402
- _subProxy.set(null);
403
- this._publishDynamicFilling_(key, null);
382
+ const currentValue: any = (this._value_ as any)[key];
383
+
384
+ if (key != "_parent_") {
385
+ if (
386
+ currentValue === undefined &&
387
+ currentValue !== null &&
388
+ isNaN(Number(key))
389
+ ) {
390
+ _subProxy.set(null);
391
+ this._publishDynamicFilling_(key, null);
404
392
  }
405
393
  }
406
394
  });
407
-
408
-
395
+
409
396
  /**
410
397
  * On prévient les écouteurs que la valeur a changé
411
398
  */
@@ -414,7 +401,7 @@ export class PublisherProxy<T = any> {
414
401
  if (this.parent && this._parentKey_)
415
402
  this.parent._publishDynamicFilling_(
416
403
  this._parentKey_,
417
- (this._value_ as any)
404
+ this._value_ as any
418
405
  );
419
406
  /**
420
407
  * Si la donnée est complexe (objet, tableau)
@@ -455,7 +442,9 @@ export class PublisherProxy<T = any> {
455
442
  const v = (this._value_ as any).__value;
456
443
  return (this._cachedGet_ = (v != undefined ? v : null) as T);
457
444
  }
458
- return (this._cachedGet_ = (this._value_ != undefined ? this._value_ : null) as T);
445
+ return (this._cachedGet_ = (
446
+ this._value_ != undefined ? this._value_ : null
447
+ ) as T);
459
448
  }
460
449
  /**
461
450
  * retourner le webcomponent auquel le proxy est associé
@@ -495,7 +484,11 @@ export class PublisherManager {
495
484
  publishers = new Map<string, Publisher>();
496
485
  localStorageData: Record<
497
486
  string,
498
- { lastModifiationMS: number; data: PublisherContentType }
487
+ {
488
+ lastModifiationMS: number;
489
+ data: PublisherContentType;
490
+ expirationDelayMs?: number;
491
+ }
499
492
  > = {};
500
493
  isLocalStrorageReady: Promise<boolean> | null = null;
501
494
  constructor() {
@@ -525,9 +518,12 @@ export class PublisherManager {
525
518
  localStorage.setItem(localStorageDataKey, compressedData);
526
519
  this.localStorageData = {};
527
520
  }
528
- const expires = new Date().getTime() - 1000 * 60 * 60 * 12;
521
+ const expirationDelay = 1000 * 60 * 60 * 12;
529
522
  for (const key in this.localStorageData) {
530
523
  const item = this.localStorageData[key];
524
+ const expires =
525
+ new Date().getTime() -
526
+ (item.expirationDelayMs || expirationDelay);
531
527
  if (item.lastModifiationMS < expires) {
532
528
  delete this.localStorageData[key];
533
529
  }
@@ -612,7 +608,10 @@ export class PublisherManager {
612
608
  }
613
609
 
614
610
  initialisedData: string[] = [];
615
- get(id: string, options?: { localStorageMode?: string }) {
611
+ get(
612
+ id: string,
613
+ options?: { localStorageMode?: string; expirationDelayMs?: number }
614
+ ) {
616
615
  const hasLocalStorage = options?.localStorageMode === "enabled";
617
616
  if (!this.publishers.has(id)) {
618
617
  const data = {};
@@ -621,6 +620,9 @@ export class PublisherManager {
621
620
  }
622
621
  const publisher = this.publishers.get(id) as PublisherInterface;
623
622
  if (hasLocalStorage && this.initialisedData.indexOf(id) === -1) {
623
+ if (options?.expirationDelayMs) {
624
+ publisher._expiration_delay_ = options.expirationDelayMs;
625
+ }
624
626
  publisher._is_savable_ = true;
625
627
  this.initialisedData.push(id);
626
628
  this.setLocalData(publisher, id);
@@ -670,6 +672,7 @@ export class PublisherManager {
670
672
  if (!data) continue;
671
673
  this.localStorageData[key + "¤lang_" + HTML.getLanguage()] = {
672
674
  lastModifiationMS: new Date().getTime(),
675
+ expirationDelayMs: publisher._expiration_delay_,
673
676
  data: data,
674
677
  };
675
678
  hasChanged = true;
@@ -726,10 +729,10 @@ export class PublisherManager {
726
729
  }
727
730
  if (typeof window !== "undefined") {
728
731
  const win = window as any;
729
- win[sonicClassPrefix+"PublisherManager"] = win[sonicClassPrefix+"PublisherManager"] || PublisherManager;
732
+ win[sonicClassPrefix + "PublisherManager"] =
733
+ win[sonicClassPrefix + "PublisherManager"] || PublisherManager;
730
734
  }
731
735
 
732
-
733
736
  const internalProps: Set<string> = new Set([
734
737
  "invalidate",
735
738
  "onInvalidate",
@@ -768,6 +771,7 @@ const internalProps: Set<string> = new Set([
768
771
  "_parentKey_",
769
772
  "_value_",
770
773
  "_is_savable_",
774
+ "_expiration_delay_",
771
775
  "_lockInternalMutationPublishing_",
772
776
  "_instanceCounter_",
773
777
  "_assignmentId_",
@@ -840,6 +844,10 @@ export default class Publisher<
840
844
  publisherInstance._is_savable_ = vValue;
841
845
  return true;
842
846
  }
847
+ if (sKey == "_expiration_delay_") {
848
+ publisherInstance._expiration_delay_ = vValue;
849
+ return true;
850
+ }
843
851
  if (sKey == "_instanceCounter_") {
844
852
  publisherInstance._instanceCounter_ = vValue;
845
853
  return true;
File without changes
File without changes
package/src/docs/code.ts CHANGED
@@ -241,6 +241,7 @@ export class DocsCode extends LitElement {
241
241
  type="neutral"
242
242
  icon
243
243
  @click=${this.handleGetSDUI}
244
+ noAutoFill
244
245
  >
245
246
  SDUI
246
247
  </sonic-button>`
@@ -253,6 +254,7 @@ export class DocsCode extends LitElement {
253
254
  type="info"
254
255
  icon
255
256
  @click=${this.handleToggleCode}
257
+ noAutoFill
256
258
  >
257
259
  <sonic-icon
258
260
  library="heroicons"
package/src/docs/docs.ts CHANGED
File without changes
@@ -90,7 +90,7 @@ export class SonicComponent extends Subscriber(LitElement) {
90
90
  />
91
91
  </svg>
92
92
 
93
- <span class="font-headings text-4xl leading-none inline-block italic font-medium"
93
+ <span class="font-headings text-4xl leading-none inline-block italic font-semibold"
94
94
  >concorde</span
95
95
  >
96
96
  </sonic-link>
@@ -57,6 +57,10 @@ export class DocsNavigation extends LitElement {
57
57
  label: "Submit",
58
58
  href: "#core/components/functional/submit/submit.md/submit",
59
59
  },
60
+ {
61
+ label: "Submit",
62
+ href: "#core/components/functional/submit/submit.md/submit",
63
+ },
60
64
  //{label: "Subscriber", href: "#core/components/functional/subscriber/subscriber.md/subscriber"},
61
65
  {
62
66
  label: "Value",
@@ -113,6 +117,10 @@ export class DocsNavigation extends LitElement {
113
117
  label: "Select",
114
118
  href: "#core/components/ui/form/select/select.md/select",
115
119
  },
120
+ {
121
+ label: "Switch",
122
+ href: "#core/components/ui/form/switch/switch.md/switch",
123
+ },
116
124
  { label: "Table", href: "#core/components/ui/table/table.md/table" },
117
125
  {
118
126
  label: "Textarea",
@@ -265,12 +265,12 @@
265
265
  }
266
266
  },
267
267
  {
268
- "search": "if / condition",
268
+ "search": "if",
269
269
  "files": {
270
270
  "core/components/functional/if/if.md": {
271
- "title": "if / condition",
271
+ "title": "if",
272
272
  "hashes": {
273
- "if--condition": {
273
+ "if": {
274
274
  "count": 1,
275
275
  "title": "",
276
276
  "type": "page"
@@ -283,9 +283,9 @@
283
283
  "search": "The sonic-if component shows its content based on the value of its reactive property names condition\n",
284
284
  "files": {
285
285
  "core/components/functional/if/if.md": {
286
- "title": "if / condition",
286
+ "title": "if",
287
287
  "hashes": {
288
- "if--condition": {
288
+ "if": {
289
289
  "count": 1,
290
290
  "title": "",
291
291
  "type": "paragraph"
@@ -2024,6 +2024,21 @@
2024
2024
  }
2025
2025
  }
2026
2026
  },
2027
+ {
2028
+ "search": "Switch",
2029
+ "files": {
2030
+ "core/components/ui/form/switch/switch.md": {
2031
+ "title": "Switch",
2032
+ "hashes": {
2033
+ "switch": {
2034
+ "count": 1,
2035
+ "title": "",
2036
+ "type": "page"
2037
+ }
2038
+ }
2039
+ }
2040
+ }
2041
+ },
2027
2042
  {
2028
2043
  "search": "Textarea",
2029
2044
  "files": {
@@ -1,10 +1,10 @@
1
- import {html, LitElement} from "lit";
2
- import {customElement, property} from "lit/decorators.js";
3
- import {unsafeHTML} from "lit/directives/unsafe-html.js";
4
- import {Subscriber} from "@supersoniks/concorde/mixins";
5
- import {Marked} from "marked-ts";
6
- import {gfmHeadingId} from "marked-gfm-heading-id";
7
- declare const window: {marked: Marked};
1
+ import { html, LitElement } from "lit";
2
+ import { customElement, property } from "lit/decorators.js";
3
+ import { unsafeHTML } from "lit/directives/unsafe-html.js";
4
+ import { Subscriber } from "@supersoniks/concorde/mixins";
5
+ import { Marked } from "marked-ts";
6
+ import { gfmHeadingId } from "marked-gfm-heading-id";
7
+ declare const window: { marked: Marked };
8
8
  const tagName = "docs-markdown-renderer"; // For Astro.build
9
9
  const marked = window.marked;
10
10
  @customElement(tagName)
@@ -23,7 +23,7 @@ export class DocsMakdownRenderer extends Subscriber(LitElement) {
23
23
  this.requestUpdate();
24
24
  setTimeout(() => {
25
25
  const anchor = this.querySelector("#" + this.anchor) as HTMLElement;
26
-
26
+ this.appendImport();
27
27
  if (anchor) {
28
28
  document.documentElement.scrollTop = anchor.offsetTop - 95;
29
29
  } else if (!(this.anchor && this.anchor.indexOf("#") != -1)) {
@@ -34,6 +34,24 @@ export class DocsMakdownRenderer extends Subscriber(LitElement) {
34
34
  get text(): string {
35
35
  return this._text;
36
36
  }
37
+
38
+ appendImport() {
39
+ const locationHash = document.location.hash;
40
+ const isComponent = locationHash.includes("components");
41
+
42
+ if (isComponent) {
43
+ const split = locationHash.split("/");
44
+ const componentName = split.filter((name) => name.endsWith(".md")).pop();
45
+ const extractComponentName = componentName?.replace(".md", "");
46
+
47
+ const markup = `<sonic-code language="javascript" class="mb-8"
48
+ ><sonic-code language="javascript">
49
+ <template> import '@supersoniks/concorde/${extractComponentName}'; </template>
50
+ </sonic-code>
51
+ </sonic-code>`;
52
+ this.querySelector("h1")?.insertAdjacentHTML("afterend", markup);
53
+ }
54
+ }
37
55
  render() {
38
56
  return html`${unsafeHTML(this.text)}`;
39
57
  }
File without changes
File without changes
package/src/tsconfig.json CHANGED
@@ -379,6 +379,15 @@
379
379
  "./ui/form/select": [
380
380
  "/sites/concorde/src/core/components/ui/form/select/select.ts"
381
381
  ],
382
+ "./switch": [
383
+ "/sites/concorde/src/core/components/ui/form/switch/switch.ts"
384
+ ],
385
+ "./ui/switch": [
386
+ "/sites/concorde/src/core/components/ui/form/switch/switch.ts"
387
+ ],
388
+ "./ui/form/switch": [
389
+ "/sites/concorde/src/core/components/ui/form/switch/switch.ts"
390
+ ],
382
391
  "./textarea": [
383
392
  "/sites/concorde/src/core/components/ui/form/textarea/textarea.ts"
384
393
  ],
@@ -1 +1 @@
1
- {"root":["./components.ts","./concorde-loaded.ts","./decorators.ts","./directives.ts","./index.ts","./mixins.ts","./utils.ts","./core/core.ts","./core/_types/types.ts","./core/components/functional/functional.ts","./core/components/functional/date/date.ts","./core/components/functional/example/example.ts","./core/components/functional/fetch/fetch.ts","./core/components/functional/if/if.test.ts","./core/components/functional/if/if.ts","./core/components/functional/list/list.ts","./core/components/functional/mix/mix.ts","./core/components/functional/queue/queue.ts","./core/components/functional/router/redirect.ts","./core/components/functional/router/router.ts","./core/components/functional/sdui/SDUIDescriptorTransformer.ts","./core/components/functional/sdui/sdui-utils.ts","./core/components/functional/sdui/sdui.ts","./core/components/functional/sdui/types.ts","./core/components/functional/sonic-scope/sonic-scope.ts","./core/components/functional/states/states.ts","./core/components/functional/submit/submit.ts","./core/components/functional/subscriber/subscriber.ts","./core/components/functional/translation/translation.ts","./core/components/functional/value/value.ts","./core/components/ui/ui.ts","./core/components/ui/_css/scroll.ts","./core/components/ui/_css/shadow.ts","./core/components/ui/_css/size.ts","./core/components/ui/_css/type.ts","./core/components/ui/alert/alert.ts","./core/components/ui/alert-messages/alert-messages.ts","./core/components/ui/badge/badge.ts","./core/components/ui/button/button.ts","./core/components/ui/captcha/captcha.ts","./core/components/ui/card/card-footer.ts","./core/components/ui/card/card-header-descripton.ts","./core/components/ui/card/card-header.ts","./core/components/ui/card/card-main.ts","./core/components/ui/card/card.ts","./core/components/ui/divider/divider.ts","./core/components/ui/form/checkbox/checkbox.ts","./core/components/ui/form/css/form-control.ts","./core/components/ui/form/fieldset/fieldset.ts","./core/components/ui/form/fieldset/legend-description.ts","./core/components/ui/form/fieldset/legend.ts","./core/components/ui/form/form-actions/form-actions.ts","./core/components/ui/form/form-layout/form-layout.ts","./core/components/ui/form/input/input.ts","./core/components/ui/form/input/password-helper.ts","./core/components/ui/form/input/same-value-helper.ts","./core/components/ui/form/input-autocomplete/input-autocomplete.ts","./core/components/ui/form/radio/radio.ts","./core/components/ui/form/select/select.ts","./core/components/ui/form/textarea/textarea.ts","./core/components/ui/group/group.ts","./core/components/ui/icon/icon.stories.ts","./core/components/ui/icon/icon.ts","./core/components/ui/icon/icons.ts","./core/components/ui/image/image.ts","./core/components/ui/link/link.ts","./core/components/ui/loader/loader.stories.ts","./core/components/ui/loader/loader.ts","./core/components/ui/loader/styles/fixed.ts","./core/components/ui/loader/styles/inline.ts","./core/components/ui/menu/menu-item.ts","./core/components/ui/menu/menu.ts","./core/components/ui/modal/modal-actions.ts","./core/components/ui/modal/modal-close.ts","./core/components/ui/modal/modal-content.ts","./core/components/ui/modal/modal-subtitle.ts","./core/components/ui/modal/modal-title.ts","./core/components/ui/modal/modal.stories.ts","./core/components/ui/modal/modal.ts","./core/components/ui/pop/pop.ts","./core/components/ui/progress/progress.ts","./core/components/ui/table/table-caption.ts","./core/components/ui/table/table-tbody.ts","./core/components/ui/table/table-td.ts","./core/components/ui/table/table-tfoot.ts","./core/components/ui/table/table-th.ts","./core/components/ui/table/table-thead.ts","./core/components/ui/table/table-tr.ts","./core/components/ui/table/table.ts","./core/components/ui/theme/theme.ts","./core/components/ui/theme/theme-collection/core-variables.ts","./core/components/ui/theme/theme-collection/dark.ts","./core/components/ui/theme/theme-collection/light.ts","./core/components/ui/toast/message-subscriber.stories.ts","./core/components/ui/toast/message-subscriber.ts","./core/components/ui/toast/toast-item.ts","./core/components/ui/toast/toast.ts","./core/components/ui/toast/types.ts","./core/components/ui/tooltip/tooltip.ts","./core/decorators/Subscriber.ts","./core/directives/DataProvider.ts","./core/directives/Wording.ts","./core/mixins/Fetcher.ts","./core/mixins/FormCheckable.ts","./core/mixins/FormElement.ts","./core/mixins/FormInput.ts","./core/mixins/Subscriber.ts","./core/mixins/TemplatesContainer.ts","./core/mixins/mixins.ts","./core/utils/Arrays.ts","./core/utils/DataBindObserver.ts","./core/utils/Electron.ts","./core/utils/Format.ts","./core/utils/HTML.ts","./core/utils/LocationHandler.ts","./core/utils/Objects.ts","./core/utils/PublisherProxy.ts","./core/utils/Utils.ts","./core/utils/api.ts","./core/utils/route.ts","./core/utils/url-pattern.ts","./test-utils/TestUtils.ts"],"version":"5.6.3"}
1
+ {"root":["./components.ts","./concorde-loaded.ts","./decorators.ts","./directives.ts","./index.ts","./mixins.ts","./utils.ts","./core/core.ts","./core/_types/types.ts","./core/components/functional/functional.ts","./core/components/functional/date/date.ts","./core/components/functional/example/example.ts","./core/components/functional/fetch/fetch.ts","./core/components/functional/if/if.test.ts","./core/components/functional/if/if.ts","./core/components/functional/list/list.ts","./core/components/functional/mix/mix.ts","./core/components/functional/queue/queue.ts","./core/components/functional/router/redirect.ts","./core/components/functional/router/router.ts","./core/components/functional/sdui/SDUIDescriptorTransformer.ts","./core/components/functional/sdui/sdui-utils.ts","./core/components/functional/sdui/sdui.ts","./core/components/functional/sdui/types.ts","./core/components/functional/sonic-scope/sonic-scope.ts","./core/components/functional/states/states.ts","./core/components/functional/submit/submit.ts","./core/components/functional/subscriber/subscriber.ts","./core/components/functional/translation/translation.ts","./core/components/functional/value/value.ts","./core/components/ui/ui.ts","./core/components/ui/_css/scroll.ts","./core/components/ui/_css/shadow.ts","./core/components/ui/_css/size.ts","./core/components/ui/_css/type.ts","./core/components/ui/alert/alert.ts","./core/components/ui/alert-messages/alert-messages.ts","./core/components/ui/badge/badge.ts","./core/components/ui/button/button.ts","./core/components/ui/captcha/captcha.ts","./core/components/ui/card/card-footer.ts","./core/components/ui/card/card-header-descripton.ts","./core/components/ui/card/card-header.ts","./core/components/ui/card/card-main.ts","./core/components/ui/card/card.ts","./core/components/ui/divider/divider.ts","./core/components/ui/form/checkbox/checkbox.ts","./core/components/ui/form/css/form-control.ts","./core/components/ui/form/fieldset/fieldset.ts","./core/components/ui/form/fieldset/legend-description.ts","./core/components/ui/form/fieldset/legend.ts","./core/components/ui/form/form-actions/form-actions.ts","./core/components/ui/form/form-layout/form-layout.ts","./core/components/ui/form/input/input.ts","./core/components/ui/form/input/password-helper.ts","./core/components/ui/form/input/same-value-helper.ts","./core/components/ui/form/input-autocomplete/input-autocomplete.ts","./core/components/ui/form/radio/radio.ts","./core/components/ui/form/select/select.ts","./core/components/ui/form/switch/switch.ts","./core/components/ui/form/textarea/textarea.ts","./core/components/ui/group/group.ts","./core/components/ui/icon/icon.stories.ts","./core/components/ui/icon/icon.ts","./core/components/ui/icon/icons.ts","./core/components/ui/image/image.ts","./core/components/ui/link/link.ts","./core/components/ui/loader/loader.stories.ts","./core/components/ui/loader/loader.ts","./core/components/ui/loader/styles/fixed.ts","./core/components/ui/loader/styles/inline.ts","./core/components/ui/menu/menu-item.ts","./core/components/ui/menu/menu.ts","./core/components/ui/modal/modal-actions.ts","./core/components/ui/modal/modal-close.ts","./core/components/ui/modal/modal-content.ts","./core/components/ui/modal/modal-subtitle.ts","./core/components/ui/modal/modal-title.ts","./core/components/ui/modal/modal.stories.ts","./core/components/ui/modal/modal.ts","./core/components/ui/pop/pop.ts","./core/components/ui/progress/progress.ts","./core/components/ui/table/table-caption.ts","./core/components/ui/table/table-tbody.ts","./core/components/ui/table/table-td.ts","./core/components/ui/table/table-tfoot.ts","./core/components/ui/table/table-th.ts","./core/components/ui/table/table-thead.ts","./core/components/ui/table/table-tr.ts","./core/components/ui/table/table.ts","./core/components/ui/theme/theme.ts","./core/components/ui/theme/theme-collection/core-variables.ts","./core/components/ui/theme/theme-collection/dark.ts","./core/components/ui/theme/theme-collection/light.ts","./core/components/ui/toast/message-subscriber.stories.ts","./core/components/ui/toast/message-subscriber.ts","./core/components/ui/toast/toast-item.ts","./core/components/ui/toast/toast.ts","./core/components/ui/toast/types.ts","./core/components/ui/tooltip/tooltip.ts","./core/decorators/Subscriber.ts","./core/directives/DataProvider.ts","./core/directives/Wording.ts","./core/mixins/Fetcher.ts","./core/mixins/FormCheckable.ts","./core/mixins/FormElement.ts","./core/mixins/FormInput.ts","./core/mixins/Subscriber.ts","./core/mixins/TemplatesContainer.ts","./core/mixins/mixins.ts","./core/utils/Arrays.ts","./core/utils/DataBindObserver.ts","./core/utils/Electron.ts","./core/utils/Format.ts","./core/utils/HTML.ts","./core/utils/LocationHandler.ts","./core/utils/Objects.ts","./core/utils/PublisherProxy.ts","./core/utils/Utils.ts","./core/utils/api.ts","./core/utils/route.ts","./core/utils/url-pattern.ts","./test-utils/TestUtils.ts"],"version":"5.6.3"}
package/vite/config.js CHANGED
File without changes