@supersoniks/concorde 1.1.41 → 1.1.43

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 (234) 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 +2 -3
  5. package/concorde-core.bundle.js +37 -42
  6. package/concorde-core.es.js +5702 -4823
  7. package/core/_types/types.d.ts +26 -0
  8. package/core/_types/types.js +1 -0
  9. package/core/components/functional/date/date.d.ts +13 -5
  10. package/core/components/functional/date/date.js +48 -29
  11. package/core/components/functional/example/example.d.ts +1 -1
  12. package/core/components/functional/example/example.js +1 -1
  13. package/core/components/functional/fetch/fetch.d.ts +40 -3
  14. package/core/components/functional/fetch/fetch.js +2 -6
  15. package/core/components/functional/functional.d.ts +2 -0
  16. package/core/components/functional/functional.js +2 -0
  17. package/core/components/functional/if/if.d.ts +3 -0
  18. package/core/components/functional/if/if.js +6 -12
  19. package/core/components/functional/if/if.test.d.ts +1 -0
  20. package/core/components/functional/if/if.test.js +44 -0
  21. package/core/components/functional/list/list.d.ts +32 -8
  22. package/core/components/functional/list/list.js +33 -40
  23. package/core/components/functional/mix/mix.d.ts +22 -0
  24. package/core/components/functional/mix/mix.js +99 -0
  25. package/core/components/functional/queue/queue.d.ts +16 -3
  26. package/core/components/functional/queue/queue.js +71 -15
  27. package/core/components/functional/router/redirect.d.ts +10 -1
  28. package/core/components/functional/router/redirect.js +5 -6
  29. package/core/components/functional/router/router.d.ts +15 -1
  30. package/core/components/functional/router/router.js +1 -6
  31. package/core/components/functional/sdui/SDUIDescriptorTransformer.d.ts +1 -1
  32. package/core/components/functional/sdui/SDUIDescriptorTransformer.js +24 -12
  33. package/core/components/functional/sdui/default-library.json +108 -0
  34. package/core/components/functional/sdui/sdui-utils.d.ts +5 -0
  35. package/core/components/functional/sdui/sdui-utils.js +63 -0
  36. package/core/components/functional/sdui/sdui.d.ts +20 -9
  37. package/core/components/functional/sdui/sdui.js +64 -24
  38. package/core/components/functional/sdui/types.d.ts +4 -2
  39. package/core/components/functional/sdui/types.js +0 -0
  40. package/core/components/functional/sonic-scope/sonic-scope.d.ts +0 -0
  41. package/core/components/functional/sonic-scope/sonic-scope.js +0 -0
  42. package/core/components/functional/states/states.d.ts +19 -3
  43. package/core/components/functional/states/states.js +7 -12
  44. package/core/components/functional/submit/submit.d.ts +16 -1
  45. package/core/components/functional/submit/submit.js +87 -17
  46. package/core/components/functional/subscriber/subscriber.d.ts +4 -1
  47. package/core/components/functional/subscriber/subscriber.js +1 -6
  48. package/core/components/functional/value/value.d.ts +7 -0
  49. package/core/components/functional/value/value.js +26 -0
  50. package/core/components/ui/_css/scroll.d.ts +0 -0
  51. package/core/components/ui/_css/scroll.js +6 -7
  52. package/core/components/ui/_css/size.d.ts +1 -0
  53. package/core/components/ui/_css/size.js +3 -1
  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 +2 -2
  57. package/core/components/ui/alert/alert.js +11 -16
  58. package/core/components/ui/badge/badge.d.ts +3 -1
  59. package/core/components/ui/badge/badge.js +36 -22
  60. package/core/components/ui/button/button.d.ts +23 -20
  61. package/core/components/ui/button/button.js +59 -42
  62. package/core/components/ui/captcha/captcha.d.ts +14 -2
  63. package/core/components/ui/captcha/captcha.js +17 -12
  64. package/core/components/ui/card/card-footer.d.ts +0 -0
  65. package/core/components/ui/card/card-footer.js +1 -8
  66. package/core/components/ui/card/card-header-descripton.d.ts +0 -0
  67. package/core/components/ui/card/card-header-descripton.js +3 -9
  68. package/core/components/ui/card/card-header.d.ts +0 -0
  69. package/core/components/ui/card/card-header.js +1 -6
  70. package/core/components/ui/card/card-main.d.ts +0 -0
  71. package/core/components/ui/card/card-main.js +0 -5
  72. package/core/components/ui/card/card.d.ts +1 -1
  73. package/core/components/ui/card/card.js +28 -12
  74. package/core/components/ui/divider/divider.d.ts +2 -0
  75. package/core/components/ui/divider/divider.js +44 -17
  76. package/core/components/ui/form/checkbox/checkbox.d.ts +53 -16
  77. package/core/components/ui/form/checkbox/checkbox.js +54 -29
  78. package/core/components/ui/form/css/form-control.d.ts +2 -0
  79. package/core/components/ui/form/css/form-control.js +145 -67
  80. package/core/components/ui/form/fieldset/fieldset.d.ts +8 -1
  81. package/core/components/ui/form/fieldset/fieldset.js +45 -8
  82. package/core/components/ui/form/fieldset/legend-description.d.ts +0 -0
  83. package/core/components/ui/form/fieldset/legend-description.js +0 -5
  84. package/core/components/ui/form/fieldset/legend.d.ts +0 -0
  85. package/core/components/ui/form/fieldset/legend.js +4 -7
  86. package/core/components/ui/form/form-actions/form-actions.d.ts +2 -0
  87. package/core/components/ui/form/form-actions/form-actions.js +26 -11
  88. package/core/components/ui/form/form-layout/form-layout.d.ts +5 -2
  89. package/core/components/ui/form/form-layout/form-layout.js +31 -9
  90. package/core/components/ui/form/input/input.d.ts +15 -18
  91. package/core/components/ui/form/input/input.js +89 -54
  92. package/core/components/ui/form/input/password-helper.d.ts +7 -1
  93. package/core/components/ui/form/input/password-helper.js +33 -10
  94. package/core/components/ui/form/input/same-value-helper.d.ts +1 -1
  95. package/core/components/ui/form/input/same-value-helper.js +1 -0
  96. package/core/components/ui/form/input-autocomplete/input-autocomplete.d.ts +34 -0
  97. package/core/components/ui/form/input-autocomplete/input-autocomplete.js +133 -0
  98. package/core/components/ui/form/radio/radio.d.ts +6 -0
  99. package/core/components/ui/form/radio/radio.js +7 -12
  100. package/core/components/ui/form/select/select.d.ts +23 -7
  101. package/core/components/ui/form/select/select.js +71 -40
  102. package/core/components/ui/form/textarea/textarea.d.ts +13 -13
  103. package/core/components/ui/form/textarea/textarea.js +31 -38
  104. package/core/components/ui/group/group.d.ts +11 -1
  105. package/core/components/ui/group/group.js +79 -17
  106. package/core/components/ui/icon/icon.d.ts +10 -3
  107. package/core/components/ui/icon/icon.js +16 -15
  108. package/core/components/ui/icon/icons.d.ts +0 -0
  109. package/core/components/ui/icon/icons.js +11 -8
  110. package/core/components/ui/icon/icons.json +1 -1
  111. package/core/components/ui/image/image.d.ts +0 -0
  112. package/core/components/ui/image/image.js +0 -5
  113. package/core/components/ui/link/link.d.ts +1 -1
  114. package/core/components/ui/link/link.js +2 -6
  115. package/core/components/ui/loader/loader.d.ts +0 -0
  116. package/core/components/ui/loader/loader.js +2 -8
  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 +4 -9
  123. package/core/components/ui/menu/menu.d.ts +9 -1
  124. package/core/components/ui/menu/menu.js +183 -27
  125. package/core/components/ui/modal/modal-actions.d.ts +0 -0
  126. package/core/components/ui/modal/modal-actions.js +1 -6
  127. package/core/components/ui/modal/modal-close.d.ts +1 -0
  128. package/core/components/ui/modal/modal-close.js +14 -10
  129. package/core/components/ui/modal/modal-content.d.ts +0 -0
  130. package/core/components/ui/modal/modal-content.js +0 -5
  131. package/core/components/ui/modal/modal-subtitle.d.ts +0 -0
  132. package/core/components/ui/modal/modal-subtitle.js +2 -6
  133. package/core/components/ui/modal/modal-title.d.ts +0 -0
  134. package/core/components/ui/modal/modal-title.js +0 -5
  135. package/core/components/ui/modal/modal.d.ts +7 -7
  136. package/core/components/ui/modal/modal.js +36 -36
  137. package/core/components/ui/pop/pop.d.ts +2 -1
  138. package/core/components/ui/pop/pop.js +11 -10
  139. package/core/components/ui/progress/progress.d.ts +0 -0
  140. package/core/components/ui/progress/progress.js +34 -32
  141. package/core/components/ui/table/table-caption.d.ts +0 -0
  142. package/core/components/ui/table/table-caption.js +5 -10
  143. package/core/components/ui/table/table-tbody.d.ts +0 -0
  144. package/core/components/ui/table/table-tbody.js +10 -14
  145. package/core/components/ui/table/table-td.d.ts +2 -0
  146. package/core/components/ui/table/table-td.js +8 -5
  147. package/core/components/ui/table/table-tfoot.d.ts +0 -0
  148. package/core/components/ui/table/table-tfoot.js +5 -7
  149. package/core/components/ui/table/table-th.d.ts +2 -0
  150. package/core/components/ui/table/table-th.js +12 -9
  151. package/core/components/ui/table/table-thead.d.ts +0 -0
  152. package/core/components/ui/table/table-thead.js +1 -6
  153. package/core/components/ui/table/table-tr.d.ts +0 -0
  154. package/core/components/ui/table/table-tr.js +4 -6
  155. package/core/components/ui/table/table.d.ts +0 -3
  156. package/core/components/ui/table/table.js +14 -31
  157. package/core/components/ui/taxonomy/taxonomy.d.ts +6 -3
  158. package/core/components/ui/taxonomy/taxonomy.js +9 -9
  159. package/core/components/ui/theme/css/tailwind.css +0 -0
  160. package/core/components/ui/theme/css/tailwind.d.ts +0 -0
  161. package/core/components/ui/theme/theme-collection/core-variables.d.ts +0 -0
  162. package/core/components/ui/theme/theme-collection/core-variables.js +13 -11
  163. package/core/components/ui/theme/theme-collection/dark.d.ts +0 -0
  164. package/core/components/ui/theme/theme-collection/dark.js +1 -1
  165. package/core/components/ui/theme/theme-collection/light.d.ts +0 -0
  166. package/core/components/ui/theme/theme-collection/light.js +0 -0
  167. package/core/components/ui/theme/theme.d.ts +1 -6
  168. package/core/components/ui/theme/theme.js +7 -36
  169. package/core/components/ui/toast/message-subscriber.d.ts +13 -7
  170. package/core/components/ui/toast/message-subscriber.js +0 -0
  171. package/core/components/ui/toast/toast-item.d.ts +0 -0
  172. package/core/components/ui/toast/toast-item.js +1 -1
  173. package/core/components/ui/toast/toast.d.ts +2 -1
  174. package/core/components/ui/toast/toast.js +29 -14
  175. package/core/components/ui/toast/types.d.ts +0 -0
  176. package/core/components/ui/toast/types.js +0 -0
  177. package/core/components/ui/tooltip/tooltip.d.ts +1 -0
  178. package/core/components/ui/tooltip/tooltip.js +35 -14
  179. package/core/components/ui/ui.d.ts +1 -0
  180. package/core/components/ui/ui.js +1 -3
  181. package/core/core.d.ts +0 -0
  182. package/core/core.js +5 -6
  183. package/core/mixins/Fetcher.d.ts +19 -10
  184. package/core/mixins/Fetcher.js +26 -10
  185. package/core/mixins/FormCheckable.d.ts +17 -8
  186. package/core/mixins/FormCheckable.js +177 -22
  187. package/core/mixins/FormElement.d.ts +12 -7
  188. package/core/mixins/FormElement.js +42 -26
  189. package/core/mixins/FormInput.d.ts +8 -4
  190. package/core/mixins/FormInput.js +4 -3
  191. package/core/mixins/Subscriber.d.ts +7 -5
  192. package/core/mixins/Subscriber.js +34 -32
  193. package/core/mixins/TemplatesContainer.d.ts +0 -0
  194. package/core/mixins/TemplatesContainer.js +0 -0
  195. package/core/mixins/mixins.d.ts +0 -0
  196. package/core/mixins/mixins.js +0 -0
  197. package/core/utils/Arrays.d.ts +15 -15
  198. package/core/utils/Arrays.js +0 -0
  199. package/core/utils/DataBindObserver.d.ts +16 -9
  200. package/core/utils/DataBindObserver.js +23 -28
  201. package/core/utils/Electron.d.ts +5 -1
  202. package/core/utils/Electron.js +4 -2
  203. package/core/utils/Format.d.ts +0 -0
  204. package/core/utils/Format.js +0 -0
  205. package/core/utils/HTML.d.ts +9 -2
  206. package/core/utils/HTML.js +22 -3
  207. package/core/utils/LocationHandler.d.ts +6 -5
  208. package/core/utils/LocationHandler.js +19 -8
  209. package/core/utils/Objects.d.ts +7 -4
  210. package/core/utils/Objects.js +28 -6
  211. package/core/utils/{PublisherProxy.d.mts → PublisherProxy.d.ts} +40 -31
  212. package/core/utils/{PublisherProxy.mjs → PublisherProxy.js} +54 -28
  213. package/core/utils/Utils.d.ts +3 -0
  214. package/core/utils/Utils.js +18 -0
  215. package/core/utils/api.d.ts +39 -7
  216. package/core/utils/api.js +45 -32
  217. package/img/concorde-logo.svg +1 -0
  218. package/img/concorde.png +0 -0
  219. package/img/concorde_def.png +0 -0
  220. package/mixins.d.ts +36 -18
  221. package/mixins.js +3 -4
  222. package/package.json +47 -10
  223. package/svg/regular/plane.svg +1 -0
  224. package/svg/solid/plane.svg +1 -0
  225. package/test-utils/TestUtils.d.ts +4 -0
  226. package/test-utils/TestUtils.js +12 -0
  227. package/utils.d.ts +3 -1
  228. package/utils.js +7 -5
  229. package/core/components/functional/configuration/configuration.d.ts +0 -5
  230. package/core/components/functional/configuration/configuration.js +0 -22
  231. package/core/components/ui/tabs/tab.d.ts +0 -6
  232. package/core/components/ui/tabs/tab.js +0 -46
  233. package/core/components/ui/tabs/tabs.d.ts +0 -15
  234. package/core/components/ui/tabs/tabs.js +0 -129
@@ -6,32 +6,37 @@ declare const Button_base: {
6
6
  forceAutoFill: boolean;
7
7
  unique: true | null;
8
8
  radio: true | null;
9
- _checked: true | null;
10
- checked: true | null;
9
+ unCheckOnDisconnect: boolean;
10
+ _checked: true | "indeterminate" | null;
11
+ checked: true | "indeterminate" | null;
11
12
  validateFormElement(): void;
12
- setCheckedValue(checked: true | null): void;
13
+ checksAll(): boolean;
14
+ setCheckedValue(checked: true | "indeterminate" | null): void;
13
15
  handleChange(): void;
14
16
  getValueForFormPublisher(): any;
15
- setFormValueFromPublisher(value: any): void;
16
- initPublisher(): void;
17
+ setFormValueFromPublisher(value: string | (string | null)[] | null): void;
18
+ getCheckAllPublisher(): any;
19
+ updateAllChecked: () => void;
20
+ onChecksAllRequest: (value: string) => void;
21
+ disconnectedCallback(): void;
22
+ connectedCallback(): void;
17
23
  getFormPublisher(): any;
18
24
  updateDataValue(): void;
19
- handleBlur(e?: any): void;
25
+ handleBlur(e?: Event | undefined): void;
26
+ focus?: (() => void) | undefined;
27
+ shadowRoot?: ShadowRoot | undefined;
20
28
  error: boolean;
21
29
  autofocus: boolean;
22
30
  required: boolean;
23
31
  disabled: true | null;
24
32
  formDataProvider: string;
33
+ ariaLabelledby?: string | undefined;
34
+ ariaLabel?: string | undefined;
25
35
  _name: string;
26
36
  name: string;
27
37
  props: any;
28
38
  propertyMap: Object;
29
- isConnected: boolean; /**
30
- * Un bouton simple avec deux slots, un nommé préfix et un nomé suffix de manière à pouvoir mettre (par exemple) une icone avant ou après le contenu.
31
- * * L'objet et ses slot sont en display flex avec direction / alignement et justifications configurables
32
- * * Le bouton est comparable au badge car il possèdent tous les deux les propriétés *type* (primary...), *variant*(outline, ghost), size(xs...)...
33
- * * Le bouton possède cependant et notamment une propriété href contrairement à un badge
34
- */
39
+ isConnected: boolean;
35
40
  getAncestorAttributeValue(attributeName: string): string;
36
41
  hasAncestorAttribute(attributeName: string): boolean;
37
42
  querySelectorAll(selector: string): NodeListOf<Element>;
@@ -46,14 +51,13 @@ declare const Button_base: {
46
51
  addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
47
52
  removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions | undefined): void;
48
53
  removeAttribute(name: string): void;
54
+ initPublisher(): void;
49
55
  getApiConfiguration(): import("../../../utils/api").APIConfiguration;
50
- connectedCallback(): void;
51
56
  requestUpdate(): void;
52
57
  getAttribute(name: string): string;
53
58
  hasAttribute(attributeName: String): boolean;
54
- disconnectedCallback(): void;
55
59
  };
56
- } & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/FormElement").FormElementInterface) & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface) & typeof LitElement;
60
+ } & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/FormElement").FormElementInterface) & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<any>) & typeof LitElement;
57
61
  /**
58
62
  * Un bouton simple avec deux slots, un nommé préfix et un nomé suffix de manière à pouvoir mettre (par exemple) une icone avant ou après le contenu.
59
63
  * * L'objet et ses slot sont en display flex avec direction / alignement et justifications configurables
@@ -101,15 +105,15 @@ export declare class Button extends Button_base {
101
105
  */
102
106
  minWidth: string;
103
107
  /**
104
- * Si un bouton n'a qu'une icone pour contenu, agrandi l'icone pour des raisons d'équilibre
105
- */
108
+ * Si un bouton n'a qu'une icone pour contenu, agrandi l'icone pour des raisons d'équilibre
109
+ */
106
110
  icon: boolean;
107
111
  /**
108
112
  * mode d'activation du bouton :
109
113
  * - strict : l'url courante match exactement avec le href du bouton
110
114
  * - partial : l'url courante match à gauche avec le href du bouton
111
115
  * - disabled : aucune activation / désactivation
112
- */
116
+ */
113
117
  autoActive: "strict" | "partial" | "disabled";
114
118
  /**
115
119
  * Laisse apparaitre un loader en remplacement du contenu du bouton.
@@ -137,7 +141,7 @@ export declare class Button extends Button_base {
137
141
  pushState: boolean;
138
142
  active: boolean;
139
143
  handleNavigation(e: Event): void;
140
- handleChange(e?: any): void;
144
+ handleChange(e?: Event): void;
141
145
  connectedCallback(): void;
142
146
  setCheckedValue(checked: true | null): void;
143
147
  disconnectedCallback(): void;
@@ -147,5 +151,4 @@ export declare class Button extends Button_base {
147
151
  render(): import("lit-html").TemplateResult<1>;
148
152
  onSlotChange(): void;
149
153
  }
150
- export declare const SonicButton: typeof Button;
151
154
  export {};
@@ -13,7 +13,8 @@ import FormCheckable from "@supersoniks/concorde/core/mixins/FormCheckable";
13
13
  import Subscriber from "@supersoniks/concorde/core/mixins/Subscriber";
14
14
  import { ifDefined } from "lit/directives/if-defined.js";
15
15
  import { fontSize } from "@supersoniks/concorde/core/components/ui/_css/size";
16
- const tagName = 'sonic-button';
16
+ import { PublisherManager } from "@supersoniks/concorde/utils";
17
+ const tagName = "sonic-button";
17
18
  /**
18
19
  * Un bouton simple avec deux slots, un nommé préfix et un nomé suffix de manière à pouvoir mettre (par exemple) une icone avant ou après le contenu.
19
20
  * * L'objet et ses slot sont en display flex avec direction / alignement et justifications configurables
@@ -54,15 +55,15 @@ let Button = class Button extends FormCheckable(FormElement(Subscriber(LitElemen
54
55
  */
55
56
  this.minWidth = "0";
56
57
  /**
57
- * Si un bouton n'a qu'une icone pour contenu, agrandi l'icone pour des raisons d'équilibre
58
- */
58
+ * Si un bouton n'a qu'une icone pour contenu, agrandi l'icone pour des raisons d'équilibre
59
+ */
59
60
  this.icon = false;
60
61
  /**
61
62
  * mode d'activation du bouton :
62
63
  * - strict : l'url courante match exactement avec le href du bouton
63
64
  * - partial : l'url courante match à gauche avec le href du bouton
64
65
  * - disabled : aucune activation / désactivation
65
- */
66
+ */
66
67
  this.autoActive = "partial";
67
68
  /**
68
69
  * Laisse apparaitre un loader en remplacement du contenu du bouton.
@@ -103,23 +104,32 @@ let Button = class Button extends FormCheckable(FormElement(Subscriber(LitElemen
103
104
  handleChange(e) {
104
105
  super.handleChange(e);
105
106
  if (this.pushState || this.goBack !== null) {
106
- e.preventDefault();
107
- e.stopPropagation();
107
+ e === null || e === void 0 ? void 0 : e.preventDefault();
108
+ e === null || e === void 0 ? void 0 : e.stopPropagation();
108
109
  LocationHandler.changeFromComponent(this);
109
110
  }
111
+ if (this.hasAttribute("reset")) {
112
+ /**
113
+ * On on veut pouvoir rest un autre form que celui qui contient le bouton
114
+ */
115
+ const resetDataProvider = this.getAttribute("reset");
116
+ let formPublisher = resetDataProvider ? PublisherManager.get(resetDataProvider) : this.getFormPublisher();
117
+ if (formPublisher)
118
+ formPublisher.set({});
119
+ }
110
120
  }
111
121
  connectedCallback() {
112
122
  super.connectedCallback();
113
123
  }
114
124
  setCheckedValue(checked) {
115
125
  if (this.name) {
116
- if (checked == this._checked)
117
- return;
118
- super.setCheckedValue(checked);
119
- if (this._checked)
126
+ if (checked)
120
127
  this.setAttribute("active", "true");
121
128
  else
122
129
  this.removeAttribute("active");
130
+ if (checked == this._checked)
131
+ return;
132
+ super.setCheckedValue(checked);
123
133
  }
124
134
  }
125
135
  disconnectedCallback() {
@@ -138,11 +148,18 @@ let Button = class Button extends FormCheckable(FormElement(Subscriber(LitElemen
138
148
  flexDirection: this.direction,
139
149
  alignItems: this.alignItems,
140
150
  justifyContent: this.justify,
141
- textAlign: this.align,
151
+ align: this.align,
142
152
  minWidth: this.minWidth,
143
153
  };
144
154
  const btn = html `
145
- <button part="button" class=${this.hasPrefix || this.hasSuffix ? 'has-prefix-or-suffix' : ''} style=${styleMap(btnStyles)} @click=${this.handleChange}>
155
+ <button
156
+ part="button"
157
+ class=${this.hasPrefix || this.hasSuffix ? "has-prefix-or-suffix" : ""}
158
+ style=${styleMap(btnStyles)}
159
+ aria-label=${ifDefined(this.ariaLabel)}
160
+ aria-labelledby=${ifDefined(this.ariaLabelledby)}
161
+ @click=${this.handleChange}
162
+ >
146
163
  <slot @slotchange=${this.onSlotChange} part="prefix" name="prefix"></slot>
147
164
  <slot part="main" class="main-slot"></slot>
148
165
  <slot @slotchange=${this.onSlotChange} part="suffix" name="suffix"></slot>
@@ -150,7 +167,14 @@ let Button = class Button extends FormCheckable(FormElement(Subscriber(LitElemen
150
167
  </button>
151
168
  `;
152
169
  return this.href
153
- ? html `<a href="${this.href}" target=${ifDefined(this.target)} @click=${this.pushState || this.goBack !== null ? this.handleNavigation : null}>${btn}</a>`
170
+ ? html `<a
171
+ href="${this.href}"
172
+ target=${ifDefined(this.target)}
173
+ aria-label=${ifDefined(this.ariaLabel)}
174
+ aria-labelledby=${ifDefined(this.ariaLabelledby)}
175
+ @click=${this.pushState || this.goBack !== null ? this.handleNavigation : null}
176
+ >${btn}</a
177
+ >`
154
178
  : html `${btn}`;
155
179
  }
156
180
  onSlotChange() {
@@ -197,11 +221,12 @@ Button.styles = [
197
221
  display: inline-flex;
198
222
  vertical-align: middle;
199
223
  box-sizing: border-box;
224
+ -webkit-print-color-adjust: exact;
200
225
  }
201
226
 
202
227
  :host a {
203
228
  display: contents;
204
- color:unset;
229
+ color: unset;
205
230
  }
206
231
 
207
232
  :host button {
@@ -219,7 +244,7 @@ Button.styles = [
219
244
  text-align: center;
220
245
  line-height: 1.1;
221
246
  border-radius: var(--sc-item-rounded-tl) var(--sc-item-rounded-tr) var(--sc-item-rounded-br)
222
- var(--sc-item-rounded-bl);
247
+ var(--sc-item-rounded-bl);
223
248
 
224
249
  background: var(--sc-btn-bg);
225
250
  color: var(--sc-btn-color);
@@ -277,13 +302,14 @@ Button.styles = [
277
302
  --sc-btn-bg: var(--sc-base-600);
278
303
  }
279
304
 
280
-
281
305
  /*UNSTYLED*/
282
- :host([variant="unstyled"]),
306
+ :host([variant="unstyled"]) {
307
+ display: inline-block;
308
+ }
309
+
283
310
  :host([variant="unstyled"]) button {
284
311
  all: unset;
285
312
  display: contents;
286
- transition: 0.1s;
287
313
  cursor: pointer;
288
314
  --sc-btn-height: auto;
289
315
  --sc-btn-width: auto;
@@ -343,8 +369,8 @@ Button.styles = [
343
369
  /*OUTLINE*/
344
370
  :host([variant="link"]:not([size])) {
345
371
  vertical-align: baseline;
346
- margin-left:.25em;
347
- margin-right:.25em;
372
+ margin-left: 0.25em;
373
+ margin-right: 0.25em;
348
374
  }
349
375
 
350
376
  :host([variant="link"]:not([size])) {
@@ -386,7 +412,7 @@ Button.styles = [
386
412
  padding: 0;
387
413
  align-items: center;
388
414
  justify-content: 0;
389
- text-align:center !important;
415
+ text-align: center !important;
390
416
  }
391
417
 
392
418
  :host([shape="block"]),
@@ -401,29 +427,28 @@ Button.styles = [
401
427
  }
402
428
 
403
429
  /*ACTIVE*/
404
- :host([active]:not([variant="ghost"])) button {
430
+
431
+ :host([active]:not([variant="ghost"]):not([variant="unstyled"])) button {
405
432
  background: var(--sc-btn-active-bg);
406
433
  color: var(--sc-btn-active-color);
407
434
  border-color: var(--sc-btn-active-bg);
408
435
  }
409
436
 
410
- :host([textAlign="left"]) button {
437
+ :host([align="left"]) button {
411
438
  text-align: left;
412
439
  }
413
440
 
414
- :host([textAlign="right"]) button {
441
+ :host([align="right"]) button {
415
442
  text-align: right;
416
443
  }
417
444
 
418
445
  .main-slot {
419
446
  flex-grow: 1;
420
447
  display: block;
421
- /*align-items: center;
422
- justify-content: center;*/
423
448
  }
424
449
 
425
450
  :host([minWidth]) .main-slot {
426
- flex-grow:0;
451
+ flex-grow: 0;
427
452
  }
428
453
 
429
454
  slot[name="suffix"],
@@ -435,17 +460,15 @@ Button.styles = [
435
460
  permet de tous les avoir alignés dans un menu
436
461
  */
437
462
  ::slotted(sonic-icon) {
438
- min-width: 1.28em;
463
+ min-width: 1em;
439
464
  text-align: center;
440
465
  }
441
466
 
442
-
443
- /*BOUTON Avec icone seulement*/
467
+ /*BOUTON Avec icone seulement*/
444
468
  :host([icon]) ::slotted(sonic-icon) {
445
- font-size: 1.35em;
469
+ font-size: 1.2em;
446
470
  }
447
471
 
448
-
449
472
  /*Tooltip ne joue pas sur le layout*/
450
473
  sonic-tooltip {
451
474
  display: contents;
@@ -453,11 +476,11 @@ Button.styles = [
453
476
 
454
477
  /*OUTLINE*/
455
478
  :host(:not([active])) ::slotted([swap="on"]) {
456
- display: none;
479
+ display: none !important;
457
480
  }
458
481
 
459
482
  :host([active]) ::slotted([swap="off"]) {
460
- display: none;
483
+ display: none !important;
461
484
  }
462
485
 
463
486
  /*Loading*/
@@ -540,10 +563,10 @@ __decorate([
540
563
  state()
541
564
  ], Button.prototype, "hasSuffix", void 0);
542
565
  __decorate([
543
- queryAssignedElements({ flatten: true, slot: 'prefix' })
566
+ queryAssignedElements({ flatten: true, slot: "prefix" })
544
567
  ], Button.prototype, "prefixes", void 0);
545
568
  __decorate([
546
- queryAssignedElements({ flatten: true, slot: 'suffix' })
569
+ queryAssignedElements({ flatten: true, slot: "suffix" })
547
570
  ], Button.prototype, "suffixes", void 0);
548
571
  __decorate([
549
572
  property({ type: String })
@@ -564,9 +587,3 @@ Button = __decorate([
564
587
  customElement(tagName)
565
588
  ], Button);
566
589
  export { Button };
567
- //Ajout pour Storybook
568
- try {
569
- customElements.define(tagName, Button);
570
- }
571
- catch (e) { }
572
- export const SonicButton = Button;
@@ -1,5 +1,8 @@
1
1
  import { LitElement } from "lit";
2
- declare const Captcha_base: (new (...args: any[]) => import("../../../mixins/Subscriber").SubscriberInterface) & typeof LitElement;
2
+ declare type AssignListener = {
3
+ onAssign: (listener: (value: string) => void) => void;
4
+ };
5
+ declare const Captcha_base: (new (...args: any[]) => import("../../../mixins/Subscriber").SubscriberInterface<any>) & typeof LitElement;
3
6
  /**
4
7
  * Un bouton simple avec deux slots, un nommé préfix et un nomé suffix de manière à pouvoir mettre (par exemple) une icone avant ou après le contenu.
5
8
  * * L'objet et ses slot sont en display flex avec direction / alignement et justifications configurables
@@ -9,7 +12,16 @@ declare const Captcha_base: (new (...args: any[]) => import("../../../mixins/Sub
9
12
  export declare class Captcha extends Captcha_base {
10
13
  key: string;
11
14
  action: string | null;
12
- formPublisher: any;
15
+ formPublisher?: {
16
+ needsCaptchaValidation: boolean;
17
+ captchaToken: string | AssignListener;
18
+ captchaMethod?: {
19
+ get: () => string;
20
+ };
21
+ captchaAction?: {
22
+ get: () => string;
23
+ };
24
+ };
13
25
  connectedCallback(): void;
14
26
  requestToken(): void;
15
27
  protected render(): import("lit-html").TemplateResult<1>;
@@ -28,25 +28,30 @@ let Captcha = class Captcha extends Subscriber(LitElement) {
28
28
  document.head.appendChild(script);
29
29
  super.connectedCallback();
30
30
  this.formPublisher = PublisherManager.get((_a = this.getAncestorAttributeValue("headersDataProvider")) !== null && _a !== void 0 ? _a : this.getAncestorAttributeValue("formDataProvider"));
31
- this.formPublisher.needsCaptchaValidation = true;
32
- this.formPublisher.captchaToken.onAssign((v) => {
33
- if (v == "request_token") {
34
- this.requestToken();
35
- }
36
- });
31
+ if (this.formPublisher) {
32
+ this.formPublisher.needsCaptchaValidation = true;
33
+ this.formPublisher.captchaToken.onAssign((v) => {
34
+ if (v == "request_token") {
35
+ this.requestToken();
36
+ }
37
+ });
38
+ }
37
39
  }
38
40
  requestToken() {
39
- var _a, _b, _c, _d;
40
- const win = window;
41
+ var _a, _b, _c, _d, _e;
42
+ if (!this.formPublisher)
43
+ return;
41
44
  // On récupère l'action liée au recaptcha,
42
45
  // et on vérifie qu'il ne contienne que des caractères alpha-numériques, underscore et slash
43
46
  let action = ((_c = (_a = this.action) !== null && _a !== void 0 ? _a : (_b = this.formPublisher.captchaAction) === null || _b === void 0 ? void 0 : _b.get()) !== null && _c !== void 0 ? _c : "submit").replace(/[^\w_\/]/g, "_");
44
- let method = ((_d = this.formPublisher.captchaMethod.get()) !== null && _d !== void 0 ? _d : "POST").toUpperCase();
47
+ let method = ((_e = (_d = this.formPublisher.captchaMethod) === null || _d === void 0 ? void 0 : _d.get()) !== null && _e !== void 0 ? _e : "POST").toUpperCase();
45
48
  delete this.formPublisher.captchaAction;
46
49
  delete this.formPublisher.captchaMethod;
47
- win.grecaptcha.ready(() => {
48
- win.grecaptcha.execute(this.key, { action: method + "//" + action }).then((token) => {
49
- this.formPublisher.captchaToken = token;
50
+ window.grecaptcha.ready(() => {
51
+ window.grecaptcha.execute(this.key, { action: method + "//" + action }).then((token) => {
52
+ if (this.formPublisher) {
53
+ this.formPublisher.captchaToken = token;
54
+ }
50
55
  });
51
56
  });
52
57
  }
File without changes
@@ -15,17 +15,10 @@ let CardFooter = class CardFooter extends LitElement {
15
15
  // `
16
16
  // ];
17
17
  render() {
18
- return html `
19
- <slot></slot>
20
- `;
18
+ return html ` <slot></slot> `;
21
19
  }
22
20
  };
23
21
  CardFooter = __decorate([
24
22
  customElement(tagName)
25
23
  ], CardFooter);
26
24
  export { CardFooter };
27
- //Ajout pour Storybook
28
- try {
29
- customElements.define(tagName, CardFooter);
30
- }
31
- catch (e) { }
@@ -18,21 +18,15 @@ let CardHeaderDescription = class CardHeaderDescription extends LitElement {
18
18
  };
19
19
  CardHeaderDescription.styles = [
20
20
  css `
21
-
22
21
  div {
23
- margin-top: .1em;
22
+ margin-top: 0.1em;
24
23
  font-family: var(--sc-font-family-base);
25
- font-size: .7em;
24
+ font-size: 0.7em;
26
25
  font-weight: var(--sc-font-style-base);
27
26
  }
28
-
29
- `
27
+ `,
30
28
  ];
31
29
  CardHeaderDescription = __decorate([
32
30
  customElement(tagName)
33
31
  ], CardHeaderDescription);
34
32
  export { CardHeaderDescription };
35
- try {
36
- customElements.define(tagName, CardHeaderDescription);
37
- }
38
- catch (e) { }
File without changes
@@ -28,7 +28,7 @@ let CardHeader = class CardHeader extends LitElement {
28
28
  CardHeader.styles = [
29
29
  css `
30
30
  :host {
31
- --sc-card-header-mb: 1.25rem;
31
+ --sc-card-header-mb: 1.35rem;
32
32
  --sc-card-header-font-size: 1.875rem;
33
33
  --sc-card-header-font-weight: var(--sc-headings-font-weight);
34
34
  --sc-card-header-font-style: var(--sc-headings-font-style);
@@ -67,8 +67,3 @@ CardHeader = __decorate([
67
67
  customElement(tagName)
68
68
  ], CardHeader);
69
69
  export { CardHeader };
70
- //Ajout pour Storybook
71
- try {
72
- customElements.define(tagName, CardHeader);
73
- }
74
- catch (e) { }
File without changes
@@ -26,8 +26,3 @@ CardMain = __decorate([
26
26
  customElement(tagName)
27
27
  ], CardMain);
28
28
  export { CardMain };
29
- //Ajout pour Storybook
30
- try {
31
- customElements.define(tagName, CardMain);
32
- }
33
- catch (e) { }
@@ -7,6 +7,6 @@ export declare class Card extends LitElement {
7
7
  /**
8
8
  * Le type change surtout la couleur composant
9
9
  */
10
- type: "default" | "primary" | "warning" | "danger" | "success" | "info" | "neutral" | "invert";
10
+ type: "default" | "light" | "primary" | "warning" | "danger" | "success" | "info" | "neutral" | "invert";
11
11
  render(): import("lit-html").TemplateResult<1>;
12
12
  }
@@ -34,6 +34,17 @@ Card.styles = [
34
34
  --sc-card-bg: var(--sc-base);
35
35
  --sc-card-rounded: var(--sc-rounded-lg);
36
36
  --sc-card-shadow: var(--sc-shadow-lg);
37
+ -webkit-print-color-adjust: exact;
38
+ }
39
+
40
+ @media print {
41
+ :host {
42
+ break-inside: avoid;
43
+ }
44
+ }
45
+
46
+ * {
47
+ box-sizing: border-box;
37
48
  }
38
49
 
39
50
  .card {
@@ -46,34 +57,44 @@ Card.styles = [
46
57
 
47
58
  /*TYPES*/
48
59
  :host([type="primary"]) {
60
+ --sc-card-bg: var(--sc-primary);
49
61
  --sc-card-color: var(--sc-primary-content);
50
- --sc-badge-bg: var(--sc-primary);
62
+ --sc-border-color: var(--sc-primary-content);
63
+ --sc-divider-opacity: 0.2;
51
64
  }
52
65
  :host([type="warning"]) {
53
- --sc-card-color: var(--sc-warning-content);
54
66
  --sc-card-bg: var(--sc-warning);
67
+ --sc-card-color: var(--sc-warning-content);
68
+ --sc-border-color: var(--sc-primary-content);
69
+ --sc-divider-opacity: 0.2;
55
70
  }
56
71
  :host([type="danger"]) {
57
- --sc-card-color: var(--sc-danger-content);
58
72
  --sc-card-bg: var(--sc-danger);
73
+ --sc-card-color: var(--sc-danger-content);
74
+ --sc-border-color: var(--sc-primary-content);
75
+ --sc-divider-opacity: 0.2;
59
76
  }
60
77
  :host([type="info"]) {
61
- --sc-card-color: var(--sc-info-content);
62
78
  --sc-card-bg: var(--sc-info);
79
+ --sc-card-color: var(--sc-info-content);
80
+ --sc-border-color: var(--sc-primary-content);
81
+ --sc-divider-opacity: 0.2;
63
82
  }
64
83
  :host([type="success"]) {
65
- --sc-card-color: var(--sc-success-content);
66
84
  --sc-card-bg: var(--sc-success);
85
+ --sc-card-color: var(--sc-success-content);
86
+ --sc-border-color: var(--sc-primary-content);
87
+ --sc-divider-opacity: 0.2;
67
88
  }
68
89
 
69
90
  :host([type="light"]) {
70
- --sc-card-color: var(--sc-base-content);
71
91
  --sc-card-bg: var(--sc-base-100);
92
+ --sc-card-color: var(--sc-base-content);
72
93
  }
73
94
 
74
95
  :host([type="neutral"]) {
75
- --sc-card-color: var(--sc-base);
76
96
  --sc-card-bg: var(--sc-base-content);
97
+ --sc-card-color: var(--sc-base);
77
98
  }
78
99
 
79
100
  :host([type="invert"]) {
@@ -89,8 +110,3 @@ Card = __decorate([
89
110
  customElement(tagName)
90
111
  ], Card);
91
112
  export { Card };
92
- //Ajout pour Storybook
93
- try {
94
- customElements.define(tagName, Card);
95
- }
96
- catch (e) { }
@@ -6,6 +6,8 @@ export declare class Divider extends LitElement {
6
6
  label: string;
7
7
  size?: "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
8
8
  align: "left" | "right" | "center";
9
+ vertical: boolean;
10
+ noMargin: boolean;
9
11
  firstUpdated(): void;
10
12
  render(): import("lit-html").TemplateResult<1>;
11
13
  }