@supersoniks/concorde 1.1.49 → 2.0.0

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 (230) hide show
  1. package/README.md +0 -0
  2. package/cli.js +0 -0
  3. package/components.d.ts +0 -0
  4. package/components.js +0 -0
  5. package/concorde-core.bundle.js +3288 -36
  6. package/concorde-core.es.js +13149 -9458
  7. package/core/_types/types.d.ts +0 -0
  8. package/core/_types/types.js +0 -0
  9. package/core/components/functional/date/date.d.ts +0 -0
  10. package/core/components/functional/date/date.js +0 -0
  11. package/core/components/functional/example/example.d.ts +0 -0
  12. package/core/components/functional/example/example.js +0 -0
  13. package/core/components/functional/fetch/fetch.d.ts +2 -0
  14. package/core/components/functional/fetch/fetch.js +0 -0
  15. package/core/components/functional/functional.d.ts +0 -0
  16. package/core/components/functional/functional.js +0 -0
  17. package/core/components/functional/if/if.d.ts +0 -0
  18. package/core/components/functional/if/if.js +0 -0
  19. package/core/components/functional/if/if.test.d.ts +0 -0
  20. package/core/components/functional/if/if.test.js +12 -21
  21. package/core/components/functional/list/list.d.ts +4 -0
  22. package/core/components/functional/list/list.js +24 -11
  23. package/core/components/functional/mix/mix.d.ts +0 -0
  24. package/core/components/functional/mix/mix.js +0 -0
  25. package/core/components/functional/queue/queue.d.ts +0 -0
  26. package/core/components/functional/queue/queue.js +38 -70
  27. package/core/components/functional/router/redirect.d.ts +0 -0
  28. package/core/components/functional/router/redirect.js +0 -0
  29. package/core/components/functional/router/router.d.ts +0 -0
  30. package/core/components/functional/router/router.js +1 -2
  31. package/core/components/functional/sdui/SDUIDescriptorTransformer.d.ts +0 -0
  32. package/core/components/functional/sdui/SDUIDescriptorTransformer.js +28 -43
  33. package/core/components/functional/sdui/default-library.json +0 -0
  34. package/core/components/functional/sdui/sdui-utils.d.ts +0 -0
  35. package/core/components/functional/sdui/sdui-utils.js +0 -0
  36. package/core/components/functional/sdui/sdui.d.ts +2 -0
  37. package/core/components/functional/sdui/sdui.js +24 -40
  38. package/core/components/functional/sdui/types.d.ts +0 -0
  39. package/core/components/functional/sdui/types.js +0 -0
  40. package/core/components/functional/sonic-scope/sonic-scope.d.ts +1 -1
  41. package/core/components/functional/sonic-scope/sonic-scope.js +0 -0
  42. package/core/components/functional/states/states.d.ts +0 -0
  43. package/core/components/functional/states/states.js +2 -4
  44. package/core/components/functional/submit/submit.d.ts +0 -0
  45. package/core/components/functional/submit/submit.js +106 -121
  46. package/core/components/functional/subscriber/subscriber.d.ts +0 -0
  47. package/core/components/functional/subscriber/subscriber.js +0 -0
  48. package/core/components/functional/value/value.d.ts +0 -0
  49. package/core/components/functional/value/value.js +0 -0
  50. package/core/components/ui/_css/scroll.d.ts +0 -0
  51. package/core/components/ui/_css/scroll.js +0 -0
  52. package/core/components/ui/_css/size.d.ts +0 -0
  53. package/core/components/ui/_css/size.js +0 -0
  54. package/core/components/ui/_css/type.d.ts +0 -0
  55. package/core/components/ui/_css/type.js +0 -0
  56. package/core/components/ui/alert/alert.d.ts +0 -0
  57. package/core/components/ui/alert/alert.js +0 -0
  58. package/core/components/ui/badge/badge.d.ts +0 -0
  59. package/core/components/ui/badge/badge.js +0 -0
  60. package/core/components/ui/button/button.d.ts +2 -2
  61. package/core/components/ui/button/button.js +24 -41
  62. package/core/components/ui/captcha/captcha.d.ts +0 -0
  63. package/core/components/ui/captcha/captcha.js +3 -5
  64. package/core/components/ui/card/card-footer.d.ts +0 -0
  65. package/core/components/ui/card/card-footer.js +0 -0
  66. package/core/components/ui/card/card-header-descripton.d.ts +0 -0
  67. package/core/components/ui/card/card-header-descripton.js +0 -0
  68. package/core/components/ui/card/card-header.d.ts +0 -0
  69. package/core/components/ui/card/card-header.js +0 -0
  70. package/core/components/ui/card/card-main.d.ts +0 -0
  71. package/core/components/ui/card/card-main.js +0 -0
  72. package/core/components/ui/card/card.d.ts +0 -0
  73. package/core/components/ui/card/card.js +0 -0
  74. package/core/components/ui/divider/divider.d.ts +1 -1
  75. package/core/components/ui/divider/divider.js +6 -6
  76. package/core/components/ui/form/checkbox/checkbox.d.ts +3 -23
  77. package/core/components/ui/form/checkbox/checkbox.js +7 -12
  78. package/core/components/ui/form/css/form-control.d.ts +0 -0
  79. package/core/components/ui/form/css/form-control.js +0 -0
  80. package/core/components/ui/form/fieldset/fieldset.d.ts +0 -0
  81. package/core/components/ui/form/fieldset/fieldset.js +0 -0
  82. package/core/components/ui/form/fieldset/legend-description.d.ts +0 -0
  83. package/core/components/ui/form/fieldset/legend-description.js +0 -0
  84. package/core/components/ui/form/fieldset/legend.d.ts +0 -0
  85. package/core/components/ui/form/fieldset/legend.js +0 -0
  86. package/core/components/ui/form/form-actions/form-actions.d.ts +0 -0
  87. package/core/components/ui/form/form-actions/form-actions.js +0 -0
  88. package/core/components/ui/form/form-layout/form-layout.d.ts +1 -1
  89. package/core/components/ui/form/form-layout/form-layout.js +1 -1
  90. package/core/components/ui/form/input/input.d.ts +4 -6
  91. package/core/components/ui/form/input/input.js +12 -18
  92. package/core/components/ui/form/input/password-helper.d.ts +0 -0
  93. package/core/components/ui/form/input/password-helper.js +0 -0
  94. package/core/components/ui/form/input/same-value-helper.d.ts +0 -0
  95. package/core/components/ui/form/input/same-value-helper.js +0 -0
  96. package/core/components/ui/form/input-autocomplete/input-autocomplete.d.ts +5 -20
  97. package/core/components/ui/form/input-autocomplete/input-autocomplete.js +27 -93
  98. package/core/components/ui/form/radio/radio.d.ts +0 -0
  99. package/core/components/ui/form/radio/radio.js +0 -0
  100. package/core/components/ui/form/select/select.d.ts +1 -1
  101. package/core/components/ui/form/select/select.js +15 -25
  102. package/core/components/ui/form/textarea/textarea.d.ts +3 -3
  103. package/core/components/ui/form/textarea/textarea.js +8 -17
  104. package/core/components/ui/group/group.d.ts +0 -0
  105. package/core/components/ui/group/group.js +7 -15
  106. package/core/components/ui/icon/icon.d.ts +6 -12
  107. package/core/components/ui/icon/icon.js +20 -53
  108. package/core/components/ui/icon/icons.d.ts +0 -0
  109. package/core/components/ui/icon/icons.js +28 -22
  110. package/core/components/ui/icon/icons.json +0 -0
  111. package/core/components/ui/image/image.d.ts +1 -1
  112. package/core/components/ui/image/image.js +3 -3
  113. package/core/components/ui/link/link.d.ts +0 -0
  114. package/core/components/ui/link/link.js +0 -0
  115. package/core/components/ui/loader/loader.d.ts +0 -0
  116. package/core/components/ui/loader/loader.js +0 -0
  117. package/core/components/ui/loader/styles/fixed.d.ts +0 -0
  118. package/core/components/ui/loader/styles/fixed.js +0 -0
  119. package/core/components/ui/loader/styles/inline.d.ts +0 -0
  120. package/core/components/ui/loader/styles/inline.js +0 -0
  121. package/core/components/ui/menu/menu-item.d.ts +0 -0
  122. package/core/components/ui/menu/menu-item.js +0 -0
  123. package/core/components/ui/menu/menu.d.ts +0 -0
  124. package/core/components/ui/menu/menu.js +2 -4
  125. package/core/components/ui/modal/modal-actions.d.ts +1 -1
  126. package/core/components/ui/modal/modal-actions.js +4 -4
  127. package/core/components/ui/modal/modal-close.d.ts +0 -0
  128. package/core/components/ui/modal/modal-close.js +0 -0
  129. package/core/components/ui/modal/modal-content.d.ts +0 -0
  130. package/core/components/ui/modal/modal-content.js +0 -0
  131. package/core/components/ui/modal/modal-subtitle.d.ts +0 -0
  132. package/core/components/ui/modal/modal-subtitle.js +0 -0
  133. package/core/components/ui/modal/modal-title.d.ts +0 -0
  134. package/core/components/ui/modal/modal-title.js +0 -0
  135. package/core/components/ui/modal/modal.d.ts +0 -0
  136. package/core/components/ui/modal/modal.js +10 -12
  137. package/core/components/ui/pop/pop.d.ts +0 -0
  138. package/core/components/ui/pop/pop.js +3 -4
  139. package/core/components/ui/progress/progress.d.ts +0 -0
  140. package/core/components/ui/progress/progress.js +0 -0
  141. package/core/components/ui/table/table-caption.d.ts +0 -0
  142. package/core/components/ui/table/table-caption.js +0 -0
  143. package/core/components/ui/table/table-tbody.d.ts +0 -0
  144. package/core/components/ui/table/table-tbody.js +0 -0
  145. package/core/components/ui/table/table-td.d.ts +0 -0
  146. package/core/components/ui/table/table-td.js +5 -6
  147. package/core/components/ui/table/table-tfoot.d.ts +0 -0
  148. package/core/components/ui/table/table-tfoot.js +0 -0
  149. package/core/components/ui/table/table-th.d.ts +0 -0
  150. package/core/components/ui/table/table-th.js +5 -6
  151. package/core/components/ui/table/table-thead.d.ts +0 -0
  152. package/core/components/ui/table/table-thead.js +0 -0
  153. package/core/components/ui/table/table-tr.d.ts +0 -0
  154. package/core/components/ui/table/table-tr.js +8 -1
  155. package/core/components/ui/table/table.d.ts +1 -0
  156. package/core/components/ui/table/table.js +9 -1
  157. package/core/components/ui/theme/css/tailwind.css +0 -0
  158. package/core/components/ui/theme/css/tailwind.d.ts +0 -0
  159. package/core/components/ui/theme/theme-collection/core-variables.d.ts +0 -0
  160. package/core/components/ui/theme/theme-collection/core-variables.js +0 -0
  161. package/core/components/ui/theme/theme-collection/dark.d.ts +0 -0
  162. package/core/components/ui/theme/theme-collection/dark.js +0 -0
  163. package/core/components/ui/theme/theme-collection/light.d.ts +0 -0
  164. package/core/components/ui/theme/theme-collection/light.js +0 -0
  165. package/core/components/ui/theme/theme.d.ts +0 -0
  166. package/core/components/ui/theme/theme.js +5 -6
  167. package/core/components/ui/toast/message-subscriber.d.ts +0 -0
  168. package/core/components/ui/toast/message-subscriber.js +6 -8
  169. package/core/components/ui/toast/toast-item.d.ts +0 -0
  170. package/core/components/ui/toast/toast-item.js +0 -0
  171. package/core/components/ui/toast/toast.d.ts +0 -0
  172. package/core/components/ui/toast/toast.js +15 -6
  173. package/core/components/ui/toast/types.d.ts +0 -0
  174. package/core/components/ui/toast/types.js +0 -0
  175. package/core/components/ui/tooltip/tooltip.d.ts +1 -1
  176. package/core/components/ui/tooltip/tooltip.js +0 -0
  177. package/core/components/ui/ui.d.ts +0 -0
  178. package/core/components/ui/ui.js +0 -0
  179. package/core/core.d.ts +0 -0
  180. package/core/core.js +9 -0
  181. package/core/decorators/Subscriber.d.ts +0 -0
  182. package/core/decorators/Subscriber.js +0 -0
  183. package/core/directives/DataProvider.d.ts +0 -14
  184. package/core/directives/DataProvider.js +1 -16
  185. package/core/mixins/Fetcher.d.ts +2 -0
  186. package/core/mixins/Fetcher.js +67 -79
  187. package/core/mixins/FormCheckable.d.ts +0 -0
  188. package/core/mixins/FormCheckable.js +2 -3
  189. package/core/mixins/FormElement.d.ts +0 -0
  190. package/core/mixins/FormElement.js +5 -7
  191. package/core/mixins/FormInput.d.ts +1 -1
  192. package/core/mixins/FormInput.js +1 -2
  193. package/core/mixins/Subscriber.d.ts +0 -0
  194. package/core/mixins/Subscriber.js +39 -54
  195. package/core/mixins/TemplatesContainer.d.ts +0 -0
  196. package/core/mixins/TemplatesContainer.js +0 -0
  197. package/core/mixins/mixins.d.ts +0 -0
  198. package/core/mixins/mixins.js +0 -0
  199. package/core/utils/Arrays.d.ts +0 -0
  200. package/core/utils/Arrays.js +2 -1
  201. package/core/utils/DataBindObserver.d.ts +0 -0
  202. package/core/utils/DataBindObserver.js +5 -6
  203. package/core/utils/Electron.d.ts +0 -0
  204. package/core/utils/Electron.js +1 -1
  205. package/core/utils/Format.d.ts +0 -0
  206. package/core/utils/Format.js +0 -0
  207. package/core/utils/HTML.d.ts +0 -0
  208. package/core/utils/HTML.js +18 -31
  209. package/core/utils/LocationHandler.d.ts +0 -0
  210. package/core/utils/LocationHandler.js +8 -13
  211. package/core/utils/Objects.d.ts +0 -0
  212. package/core/utils/Objects.js +0 -0
  213. package/core/utils/PublisherProxy.d.ts +0 -0
  214. package/core/utils/PublisherProxy.js +108 -132
  215. package/core/utils/Utils.d.ts +0 -0
  216. package/core/utils/Utils.js +3 -14
  217. package/core/utils/api.d.ts +0 -0
  218. package/core/utils/api.js +137 -165
  219. package/img/concorde-logo.svg +0 -0
  220. package/img/concorde.png +0 -0
  221. package/img/concorde_def.png +0 -0
  222. package/mixins.d.ts +5 -3
  223. package/mixins.js +0 -0
  224. package/package.json +13 -12
  225. package/svg/regular/plane.svg +0 -0
  226. package/svg/solid/plane.svg +0 -0
  227. package/test-utils/TestUtils.d.ts +0 -0
  228. package/test-utils/TestUtils.js +0 -0
  229. package/utils.d.ts +0 -0
  230. package/utils.js +0 -0
@@ -4,18 +4,9 @@ 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 Icons from "@supersoniks/concorde/core/components/ui/icon/icons";
17
8
  import { css, LitElement, nothing } from "lit";
18
- import { customElement, property } from "lit/decorators.js";
9
+ import { customElement, property, state } from "lit/decorators.js";
19
10
  const tagName = "sonic-icon";
20
11
  /**
21
12
  * Afficher l'icone choisie parmis une liste prédéfinie dans icons.json
@@ -24,67 +15,39 @@ const tagName = "sonic-icon";
24
15
  let Icon = class Icon extends LitElement {
25
16
  constructor() {
26
17
  super(...arguments);
27
- this.renderId = 0;
28
18
  this.iconText = "";
29
19
  /**
30
20
  * Nom identifiant l'icone ex : *info*
31
21
  */
32
- this._name = "";
22
+ this.name = "";
33
23
  /**
34
24
  * prefix de l'icone si nécessaire ex: *solid*. La valeur par défaut est "" qui est mappée sur *regular*
35
25
  */
36
- this._prefix = "";
26
+ this.prefix = "";
37
27
  /**
38
28
  * library de l'icone url vers un dossier en lign conenant des icônes
39
29
  */
40
- this._library = "";
41
- }
42
- updateIcon() {
43
- if (!this.name)
44
- return;
45
- this.renderId++;
46
- const frameRenderId = this.renderId;
47
- (window.queueMicrotask || window.requestAnimationFrame)(() => __awaiter(this, void 0, void 0, function* () {
48
- if (frameRenderId != this.renderId) {
49
- return;
50
- }
51
- this.iconText = yield Icons.default.get({ name: this.name, prefix: this.prefix, library: this.library });
52
- this.requestUpdate();
53
- }));
54
- }
55
- get name() {
56
- return this._name;
57
- }
58
- set name(newName) {
59
- this._name = newName;
60
- this.updateIcon();
30
+ this.library = "";
61
31
  }
62
- get prefix() {
63
- return this._prefix;
32
+ async updateIcon() {
33
+ this.iconText = await Icons.default.get({ name: this.name, prefix: this.prefix, library: this.library });
64
34
  }
65
- set prefix(newPrefix) {
66
- this._prefix = newPrefix;
67
- this.updateIcon();
68
- }
69
- get library() {
70
- return this._library;
71
- }
72
- set library(newLibrary) {
73
- this._library = newLibrary;
74
- this.updateIcon();
35
+ willUpdate(changedProperties) {
36
+ if (changedProperties.has("name") || changedProperties.has("prefix") || changedProperties.has("library")) {
37
+ this.updateIcon();
38
+ }
39
+ super.willUpdate(changedProperties);
75
40
  }
76
41
  render() {
77
- if (!this.name) {
78
- this.style.display = "none";
42
+ if (!this.iconText) {
79
43
  return nothing;
80
44
  }
81
- this.style.removeProperty("display");
82
45
  return this.iconText;
83
46
  }
84
47
  };
85
48
  Icon.styles = css `
86
49
  :host {
87
- line-height: 0;
50
+ line-height: 0.1em;
88
51
  width: fit-content;
89
52
  height: fit-content;
90
53
  vertical-align: -0.125em;
@@ -92,6 +55,7 @@ Icon.styles = css `
92
55
  svg {
93
56
  height: var(--sc-icon-size, 1em);
94
57
  width: var(--sc-icon-size, 1em);
58
+ overflow: visible;
95
59
  }
96
60
 
97
61
  svg:not([fill="none"]) {
@@ -130,15 +94,18 @@ Icon.styles = css `
130
94
  --sc-icon-size: 2.8em;
131
95
  }
132
96
  `;
97
+ __decorate([
98
+ state()
99
+ ], Icon.prototype, "iconText", void 0);
133
100
  __decorate([
134
101
  property({ type: String })
135
- ], Icon.prototype, "name", null);
102
+ ], Icon.prototype, "name", void 0);
136
103
  __decorate([
137
104
  property({ type: String })
138
- ], Icon.prototype, "prefix", null);
105
+ ], Icon.prototype, "prefix", void 0);
139
106
  __decorate([
140
107
  property({ type: String })
141
- ], Icon.prototype, "library", null);
108
+ ], Icon.prototype, "library", void 0);
142
109
  Icon = __decorate([
143
110
  customElement(tagName)
144
111
  ], Icon);
File without changes
@@ -1,12 +1,3 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
1
  var _a;
11
2
  // ici on désactive un regle de eslint exceptionnelement pour ce fichier
12
3
  /* eslint no-async-promise-executor: 0 */ // --> OFF
@@ -48,15 +39,16 @@ const libraries = {
48
39
  };
49
40
  let hasEnabledCustomLibrary = false;
50
41
  function enableCustomLibrary() {
51
- var _b, _c;
52
42
  if (hasEnabledCustomLibrary)
53
43
  return;
54
44
  hasEnabledCustomLibrary = true;
55
- libraries.custom.url = ((_b = document.querySelector("[customIconLibraryPath]")) === null || _b === void 0 ? void 0 : _b.getAttribute("customIconLibraryPath")) || "";
56
- libraries.custom.defaultPrefix =
57
- ((_c = document.querySelector("[customIconDefaultPrefix]")) === null || _c === void 0 ? void 0 : _c.getAttribute("customIconDefaultPrefix")) || "";
45
+ libraries.custom.url = document.querySelector("[customIconLibraryPath]")?.getAttribute("customIconLibraryPath") || "";
46
+ libraries.custom.defaultPrefix = document.querySelector("[customIconDefaultPrefix]")?.getAttribute("customIconDefaultPrefix") || "";
58
47
  }
59
- export default class Icons {
48
+ const iconCachStr = sessionStorage.getItem("sonicIconsCache");
49
+ const iconCache = iconCachStr ? JSON.parse(iconCachStr) : { icons: {}, names: [] };
50
+ const iconCacheMaxSize = 100;
51
+ class Icons {
60
52
  static registerIcons(newIcons) {
61
53
  const record = icons;
62
54
  for (const prefix in newIcons) {
@@ -71,7 +63,7 @@ export default class Icons {
71
63
  }
72
64
  _a = Icons;
73
65
  Icons.fontAwesomeNext = {
74
- get: (params) => __awaiter(void 0, void 0, void 0, function* () {
66
+ get: async (params) => {
75
67
  const library = params.library;
76
68
  const name = params.name || "";
77
69
  const iconsAsRecord = icons;
@@ -94,38 +86,52 @@ Icons.fontAwesomeNext = {
94
86
  if (libIcons[libIconsKey])
95
87
  return unsafeHTML(libIcons[libIconsKey]);
96
88
  const url = libraryItem.url.replace("$prefix", prefix).replace("$name", name);
89
+ /**
90
+ * MiniCache de session
91
+ */
92
+ if (iconCache.icons[url]) {
93
+ libIcons[libIconsKey] = iconCache.icons[url];
94
+ return unsafeHTML(iconCache.icons[url]);
95
+ }
97
96
  /**
98
97
  * on utilise une promise mutualisée pour ne pas faire plusieurs appels concurents d'une même icone
99
98
  */
100
99
  if (!loadingGetPromises.has(url)) {
101
- const promise = new Promise((resolve) => __awaiter(void 0, void 0, void 0, function* () {
102
- const result = yield fetch(url);
100
+ const promise = new Promise(async (resolve) => {
101
+ const result = await fetch(url);
103
102
  if (!result.ok) {
104
103
  resolve(`<b title="Erreur ${result.status}">😶</b>`);
105
104
  return;
106
105
  }
107
106
  try {
108
- const text = yield result.text();
107
+ const text = await result.text();
109
108
  resolve(text);
110
109
  }
111
110
  catch (e) {
112
111
  resolve(null);
113
112
  }
114
- }));
113
+ });
115
114
  loadingGetPromises.set(url, promise);
116
115
  }
117
116
  /**
118
117
  * Chargement de l'icone.
119
118
  */
120
- const result = yield loadingGetPromises.get(url);
119
+ const result = await loadingGetPromises.get(url);
121
120
  loadingGetPromises.delete(url);
122
121
  libIcons[libIconsKey] = result || "";
122
+ iconCache.icons[url] = result || "";
123
+ if (iconCache.names.length > iconCacheMaxSize) {
124
+ const key = iconCache.names.shift();
125
+ delete iconCache.icons[key];
126
+ }
127
+ sessionStorage.setItem("sonicIconsCache", JSON.stringify(iconCache));
123
128
  return unsafeHTML(result);
124
129
  }
125
130
  /**
126
131
  * svgs "locaux"
127
132
  */
128
133
  return unsafeHTML(iconsAsRecord["core"][params.name] || "");
129
- }),
134
+ },
130
135
  };
131
- Icons.default = Icons.fontAwesomeNext;
136
+ Icons.default = _a.fontAwesomeNext;
137
+ export default Icons;
File without changes
@@ -10,6 +10,6 @@ export declare class Image extends LitElement {
10
10
  objectPosition: string;
11
11
  imageRendering: string;
12
12
  cover: boolean;
13
- firstUpdated(): void;
13
+ firstUpdated(changedProperties: Map<string | number | symbol, unknown>): void;
14
14
  render(): import("lit-html").TemplateResult<1>;
15
15
  }
@@ -20,16 +20,16 @@ let Image = class Image extends LitElement {
20
20
  this.imageRendering = "auto";
21
21
  this.cover = false;
22
22
  }
23
- firstUpdated() {
24
- var _a;
23
+ firstUpdated(changedProperties) {
25
24
  if (this.transition) {
26
- const img = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector("img");
25
+ const img = this.shadowRoot?.querySelector("img");
27
26
  if (!img)
28
27
  return;
29
28
  img.onload = function () {
30
29
  img.classList.add("loaded");
31
30
  };
32
31
  }
32
+ super.firstUpdated(changedProperties);
33
33
  }
34
34
  render() {
35
35
  const imgStyles = {
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
@@ -43,8 +43,7 @@ let MenuItems = class MenuItems extends LitElement {
43
43
  };
44
44
  }
45
45
  checkIfMore() {
46
- var _a;
47
- this.hasMoreElements = !!((_a = this.moreElements) === null || _a === void 0 ? void 0 : _a.length);
46
+ this.hasMoreElements = !!this.moreElements?.length;
48
47
  }
49
48
  updated(_changedProperties) {
50
49
  const moreBtn = this.querySelector(".more-btn");
@@ -70,8 +69,7 @@ let MenuItems = class MenuItems extends LitElement {
70
69
  super.connectedCallback();
71
70
  }
72
71
  disconnectedCallback() {
73
- var _a;
74
- (_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
72
+ this.observer?.disconnect();
75
73
  super.disconnectedCallback();
76
74
  }
77
75
  initScrollable() {
@@ -2,6 +2,6 @@ import { LitElement } from "lit";
2
2
  export declare class ModalActions extends LitElement {
3
3
  static styles: import("lit").CSSResult[];
4
4
  buttons: Array<HTMLElement>;
5
- firstUpdated(): void;
5
+ firstUpdated(changedProperties: Map<string | number | symbol, unknown>): void;
6
6
  render(): import("lit-html").TemplateResult<1>;
7
7
  }
@@ -8,16 +8,16 @@ import { html, LitElement, css } from "lit";
8
8
  import { customElement, queryAssignedElements } from "lit/decorators.js";
9
9
  const tagName = "sonic-modal-actions";
10
10
  let ModalActions = class ModalActions extends LitElement {
11
- firstUpdated() {
12
- var _a;
13
- (_a = this.buttons) === null || _a === void 0 ? void 0 : _a.forEach((btn) => {
11
+ firstUpdated(changedProperties) {
12
+ this.buttons?.forEach((btn) => {
14
13
  btn.addEventListener("click", () => {
15
14
  if (btn.getAttribute("hideModal") != "false") {
16
15
  const parentModal = this.closest("sonic-modal");
17
- parentModal === null || parentModal === void 0 ? void 0 : parentModal.hide();
16
+ parentModal?.hide();
18
17
  }
19
18
  });
20
19
  });
20
+ super.firstUpdated(changedProperties);
21
21
  }
22
22
  render() {
23
23
  return html `<slot></slot>`;
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
@@ -38,19 +38,19 @@ let Modal = class Modal extends Subscriber(LitElement) {
38
38
  if (options.removeOnHide === true)
39
39
  modal.setAttribute("removeOnHide", "true");
40
40
  if (options.maxWidth)
41
- modal.maxWidth = options === null || options === void 0 ? void 0 : options.maxWidth;
41
+ modal.maxWidth = options?.maxWidth;
42
42
  if (options.width)
43
- modal.width = options === null || options === void 0 ? void 0 : options.width;
43
+ modal.width = options?.width;
44
44
  if (options.maxHeight)
45
- modal.maxHeight = options === null || options === void 0 ? void 0 : options.maxHeight;
45
+ modal.maxHeight = options?.maxHeight;
46
46
  if (options.height)
47
- modal.height = options === null || options === void 0 ? void 0 : options.height;
47
+ modal.height = options?.height;
48
48
  if (options.paddingX)
49
- modal.style.setProperty("--sc-modal-px", options === null || options === void 0 ? void 0 : options.paddingX);
49
+ modal.style.setProperty("--sc-modal-px", options?.paddingX);
50
50
  if (options.paddingY)
51
- modal.style.setProperty("--sc-modal-py", options === null || options === void 0 ? void 0 : options.paddingY);
51
+ modal.style.setProperty("--sc-modal-py", options?.paddingY);
52
52
  if (options.zIndex)
53
- modal.style.setProperty("--sc-modal-z-index", options === null || options === void 0 ? void 0 : options.zIndex);
53
+ modal.style.setProperty("--sc-modal-z-index", options?.zIndex);
54
54
  // inner content
55
55
  modal.innerHTML = `<sonic-modal-close></sonic-modal-close><sonic-modal-content>${options.content}</sonic-modal-content>` || "";
56
56
  const container = document.querySelector("sonic-theme") || document.body;
@@ -136,16 +136,14 @@ let Modal = class Modal extends Subscriber(LitElement) {
136
136
  ></div>`;
137
137
  }
138
138
  show() {
139
- var _a, _b;
140
139
  this.visible = true;
141
- (_a = this.modalElement) === null || _a === void 0 ? void 0 : _a.setAttribute("tabindex", "0");
142
- (_b = this.modalElement) === null || _b === void 0 ? void 0 : _b.focus();
140
+ this.modalElement?.setAttribute("tabindex", "0");
141
+ this.modalElement?.focus();
143
142
  this.dispatchEvent(new CustomEvent("show"));
144
143
  }
145
144
  hide() {
146
- var _a;
147
145
  this.visible = false;
148
- (_a = this.modalElement) === null || _a === void 0 ? void 0 : _a.setAttribute("tabindex", "-1");
146
+ this.modalElement?.setAttribute("tabindex", "-1");
149
147
  this.dispatchEvent(new CustomEvent("hide"));
150
148
  if (this.hasAttribute("resetDataProviderOnHide")) {
151
149
  PublisherManager.get(this.getAttribute("resetDataProviderOnHide")).set({});
File without changes
@@ -99,8 +99,7 @@ let Pop = Pop_1 = class Pop extends LitElement {
99
99
  this.resizeObserver.unobserve(this.popContent);
100
100
  }
101
101
  computePosition(placement) {
102
- var _a, _b, _c;
103
- let contentRect = (_a = this.popContent) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
102
+ let contentRect = this.popContent?.getBoundingClientRect();
104
103
  const padding = 8;
105
104
  const shiftPadding = 5;
106
105
  const thisRect = this.getBoundingClientRect();
@@ -141,7 +140,7 @@ let Pop = Pop_1 = class Pop extends LitElement {
141
140
  left: `${this.lastContentX}px`,
142
141
  top: `${this.lastContentY}px`,
143
142
  });
144
- contentRect = (_b = this.popContent) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect();
143
+ contentRect = this.popContent?.getBoundingClientRect();
145
144
  if (contentRect.x < shiftPadding && placement == "left")
146
145
  x = xRight;
147
146
  if (contentRect.y < shiftPadding && placement == "top")
@@ -158,7 +157,7 @@ let Pop = Pop_1 = class Pop extends LitElement {
158
157
  left: `${this.lastContentX}px`,
159
158
  top: `${this.lastContentY}px`,
160
159
  });
161
- contentRect = (_c = this.popContent) === null || _c === void 0 ? void 0 : _c.getBoundingClientRect();
160
+ contentRect = this.popContent?.getBoundingClientRect();
162
161
  if (contentRect.x < 0) {
163
162
  this.lastContentX += -contentRect.x;
164
163
  }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -19,12 +19,7 @@ let TableTd = class TableTd extends LitElement {
19
19
  maxWidth: this.maxWidth,
20
20
  width: this.width,
21
21
  };
22
- return html `<td
23
- part="td"
24
- style=${styleMap(styles)}
25
- colspan=${ifDefined(this.colSpan)}
26
- rowspan=${ifDefined(this.rowSpan)}
27
- >
22
+ return html `<td part="td" style=${styleMap(styles)} colspan=${ifDefined(this.colSpan)} rowspan=${ifDefined(this.rowSpan)}>
28
23
  <slot></slot>
29
24
  </td>`;
30
25
  }
@@ -39,6 +34,10 @@ TableTd.styles = [
39
34
  all: inherit;
40
35
  display: table-cell;
41
36
  padding: var(--sc-table-td-py) var(--sc-table-td-px);
37
+ border-top: var(--sc-table-td-border-t, none);
38
+ border-bottom: var(--sc-table-td-border-b, none);
39
+ border-right: var(--sc-table-td-border-r, none);
40
+ border-left: var(--sc-table-td-border-l, none);
42
41
  }
43
42
  `,
44
43
  ];
File without changes
File without changes
File without changes
@@ -18,12 +18,7 @@ let TableTh = class TableTh extends LitElement {
18
18
  maxWidth: this.maxWidth,
19
19
  width: this.width,
20
20
  };
21
- return html `<th
22
- part="th"
23
- style=${styleMap(styles)}
24
- colspan=${ifDefined(this.colSpan)}
25
- rowspan=${ifDefined(this.rowSpan)}
26
- >
21
+ return html `<th part="th" style=${styleMap(styles)} colspan=${ifDefined(this.colSpan)} rowspan=${ifDefined(this.rowSpan)}>
27
22
  <slot></slot>
28
23
  </th> `;
29
24
  }
@@ -48,6 +43,10 @@ TableTh.styles = [
48
43
  font-size: var(--sc-table-th-fs);
49
44
  padding: var(--sc-table-th-py) var(--sc-table-th-px);
50
45
  }
46
+
47
+ :host([noBorder]) th {
48
+ border-bottom: none;
49
+ }
51
50
  `,
52
51
  ];
53
52
  __decorate([
File without changes
File without changes
File without changes
@@ -21,7 +21,14 @@ TableTr.styles = [
21
21
  }
22
22
 
23
23
  :host([odd]) {
24
- background: var(--sc-table-accent-bg);
24
+ background: var(--sc-table-accent-bg) !important;
25
+ }
26
+ :host([even]) {
27
+ background: var(--sc-table-bg) !important;
28
+ }
29
+
30
+ :host(:hover) {
31
+ background: var(--sc-table-hover-bg) !important;
25
32
  }
26
33
  `,
27
34
  ];
@@ -10,6 +10,7 @@ export declare class Table extends LitElement {
10
10
  static styles: import("lit").CSSResult[];
11
11
  size?: "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
12
12
  bordered: boolean;
13
+ noCustomScroll: boolean;
13
14
  maxHeight?: string;
14
15
  render(): import("lit-html").TemplateResult<1>;
15
16
  }
@@ -21,13 +21,14 @@ let Table = class Table extends LitElement {
21
21
  constructor() {
22
22
  super(...arguments);
23
23
  this.bordered = false;
24
+ this.noCustomScroll = false;
24
25
  }
25
26
  render() {
26
27
  const containerStyles = {
27
28
  maxHeight: this.maxHeight,
28
29
  };
29
30
  return html `
30
- <div class="table-container custom-scroll" style=${styleMap(containerStyles)}>
31
+ <div class="table-container ${!this.noCustomScroll ? "custom-scroll" : ""}" style=${styleMap(containerStyles)}>
31
32
  <div class="table">
32
33
  <slot></slot>
33
34
  </div>
@@ -63,6 +64,10 @@ Table.styles = [
63
64
  -webkit-overflow-scrolling: touch;
64
65
  }
65
66
 
67
+ :host(:not([maxHeight])) .table-container {
68
+ overflow: initial !important;
69
+ }
70
+
66
71
  .table {
67
72
  width: 100%;
68
73
  display: table;
@@ -80,6 +85,9 @@ __decorate([
80
85
  __decorate([
81
86
  property({ type: Boolean, reflect: true })
82
87
  ], Table.prototype, "bordered", void 0);
88
+ __decorate([
89
+ property({ type: Boolean, reflect: true })
90
+ ], Table.prototype, "noCustomScroll", void 0);
83
91
  __decorate([
84
92
  property({ type: String })
85
93
  ], Table.prototype, "maxHeight", void 0);
File without changes
File without changes
File without changes
File without changes
@@ -26,7 +26,6 @@ let Theme = Theme_1 = class Theme extends LitElement {
26
26
  this.postCSSVars();
27
27
  }
28
28
  postCSSVars() {
29
- var _a;
30
29
  const stylesheets = document.styleSheets;
31
30
  const ssLength = stylesheets.length;
32
31
  const fontUrls = [];
@@ -40,11 +39,11 @@ let Theme = Theme_1 = class Theme extends LitElement {
40
39
  variables: this.getCssVariables(),
41
40
  fonts: fontUrls,
42
41
  };
43
- (_a = PublisherManager.get("sonic-theme")) === null || _a === void 0 ? void 0 : _a.set(theme);
44
- document.querySelectorAll("iframe").forEach((elt) => {
45
- var _a;
46
- return (_a = elt.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(Object.assign({ type: "SonicTheme" }, theme), "*");
47
- });
42
+ PublisherManager.get("sonic-theme")?.set(theme);
43
+ document.querySelectorAll("iframe").forEach((elt) => elt.contentWindow?.postMessage({
44
+ type: "SonicTheme",
45
+ ...theme,
46
+ }, "*"));
48
47
  }
49
48
  receiveMessage(event) {
50
49
  const data = event.data;
File without changes