@supersoniks/concorde 1.1.49 → 2.0.1

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