@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
@@ -13,6 +13,8 @@ let Divider = class Divider extends LitElement {
13
13
  super(...arguments);
14
14
  this.label = "";
15
15
  this.align = "center";
16
+ this.vertical = false;
17
+ this.noMargin = false;
16
18
  }
17
19
  firstUpdated() {
18
20
  var _a, _b;
@@ -22,7 +24,7 @@ let Divider = class Divider extends LitElement {
22
24
  }
23
25
  render() {
24
26
  return html `<div part="divider">
25
- <span class="text">${unsafeHTML(this.label)}<slot></slot></span>
27
+ <span class="text">${unsafeHTML(this.label ? this.label : "")}<slot></slot></span>
26
28
  </div>`;
27
29
  }
28
30
  };
@@ -31,10 +33,10 @@ Divider.styles = [
31
33
  :host {
32
34
  --sc-divider-my: 0.5rem;
33
35
  --sc-divider-mx: 0;
34
- --sc-divider-border-width: min(2px, 0.15rem);
35
- --sc-divider-border-color: var(--sc-base-200);
36
+ --sc-divider-border-width: max(1px, var(--sc-border-width));
37
+ --sc-divider-border-color: var(--sc-border-color);
36
38
  --sc-divider-border-style: solid;
37
- --sc-divider-color: var(--sc-base-500);
39
+ --sc-divider-color: currentColor;
38
40
  --sc-divider-ff: var(--sc-font-family-base);
39
41
  --sc-divider-fs: 1rem;
40
42
  --sc-divider-fw: var(--sc-font-weight-base);
@@ -87,18 +89,13 @@ Divider.styles = [
87
89
  width: 100%;
88
90
  }
89
91
 
90
- div:before {
91
- content: "";
92
- flex-grow: 1;
93
- border-top: var(--sc-divider-border-width) var(--sc-divider-border-style) var(--sc-divider-border-color);
94
- width: 100%;
95
- }
96
-
97
- div:after {
92
+ div::before,
93
+ div::after {
98
94
  content: "";
99
95
  flex-grow: 1;
100
96
  border-top: var(--sc-divider-border-width) var(--sc-divider-border-style) var(--sc-divider-border-color);
101
97
  width: 100%;
98
+ opacity: var(--sc-divider-opacity, 1);
102
99
  }
103
100
 
104
101
  /*ALIGNEMENT*/
@@ -110,9 +107,37 @@ Divider.styles = [
110
107
  display: none;
111
108
  }
112
109
 
110
+ :host([vertical]) {
111
+ margin: var(--sc-divider-mx) var(--sc-divider-my);
112
+ }
113
+
114
+ :host([vertical]) div {
115
+ flex-direction: column;
116
+ height: 100%;
117
+ min-height: var(--sc-form-height);
118
+ }
119
+
120
+ :host([vertical]) .has-text {
121
+ gap: 0.25rem;
122
+ }
123
+
124
+ :host([vertical]) div::before,
125
+ :host([vertical]) div::after {
126
+ border-top: none;
127
+ border-left: var(--sc-divider-border-width) var(--sc-divider-border-style) var(--sc-divider-border-color);
128
+ width: auto;
129
+ height: 100%;
130
+ opacity: var(--sc-divider-opacity, 1);
131
+ }
132
+
133
+ :host([noMargin]) {
134
+ margin: 0;
135
+ }
136
+
113
137
  /*TEXT*/
114
138
  .text {
115
139
  flex-shrink: 0;
140
+ line-height: 1.1;
116
141
  max-width: 80%;
117
142
  }
118
143
 
@@ -140,11 +165,13 @@ __decorate([
140
165
  __decorate([
141
166
  property({ type: String, reflect: true })
142
167
  ], Divider.prototype, "align", void 0);
168
+ __decorate([
169
+ property({ type: Boolean, reflect: true })
170
+ ], Divider.prototype, "vertical", void 0);
171
+ __decorate([
172
+ property({ type: Boolean, reflect: true })
173
+ ], Divider.prototype, "noMargin", void 0);
143
174
  Divider = __decorate([
144
- customElement("sonic-divider")
175
+ customElement(tagName)
145
176
  ], Divider);
146
177
  export { Divider };
147
- try {
148
- customElements.define(tagName, Divider);
149
- }
150
- catch (e) { }
@@ -1,4 +1,4 @@
1
- import { LitElement, CSSResultGroup } from "lit";
1
+ import { LitElement, CSSResultGroup, PropertyValues } from "lit";
2
2
  import "@supersoniks/concorde/core/components/ui/icon/icon";
3
3
  declare const Checkbox_base: {
4
4
  new (...args: any[]): {
@@ -7,22 +7,32 @@ declare const Checkbox_base: {
7
7
  forceAutoFill: boolean;
8
8
  unique: true | null;
9
9
  radio: true | null;
10
- _checked: true | null;
11
- checked: true | null;
10
+ unCheckOnDisconnect: boolean;
11
+ _checked: true | "indeterminate" | null;
12
+ checked: true | "indeterminate" | null;
12
13
  validateFormElement(): void;
13
- setCheckedValue(checked: true | null): void;
14
+ checksAll(): boolean;
15
+ setCheckedValue(checked: true | "indeterminate" | null): void;
14
16
  handleChange(): void;
15
17
  getValueForFormPublisher(): any;
16
- setFormValueFromPublisher(value: any): void;
17
- initPublisher(): void;
18
+ setFormValueFromPublisher(value: string | (string | null)[] | null): void;
19
+ getCheckAllPublisher(): any;
20
+ updateAllChecked: () => void;
21
+ onChecksAllRequest: (value: string) => void;
22
+ disconnectedCallback(): void;
23
+ connectedCallback(): void;
18
24
  getFormPublisher(): any;
19
25
  updateDataValue(): void;
20
- handleBlur(e?: any): void;
26
+ handleBlur(e?: Event | undefined): void;
27
+ focus?: (() => void) | undefined;
28
+ shadowRoot?: ShadowRoot | undefined;
21
29
  error: boolean;
22
30
  autofocus: boolean;
23
31
  required: boolean;
24
32
  disabled: true | null;
25
33
  formDataProvider: string;
34
+ ariaLabelledby?: string | undefined;
35
+ ariaLabel?: string | undefined;
26
36
  _name: string;
27
37
  name: string;
28
38
  props: any;
@@ -42,12 +52,11 @@ declare const Checkbox_base: {
42
52
  addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
43
53
  removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions | undefined): void;
44
54
  removeAttribute(name: string): void;
55
+ initPublisher(): void;
45
56
  getApiConfiguration(): import("../../../../utils/api").APIConfiguration;
46
- connectedCallback(): void;
47
57
  requestUpdate(): void;
48
58
  getAttribute(name: string): string;
49
59
  hasAttribute(attributeName: String): boolean;
50
- disconnectedCallback(): void;
51
60
  };
52
61
  } & {
53
62
  new (...args: any[]): {
@@ -63,16 +72,20 @@ declare const Checkbox_base: {
63
72
  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;
64
73
  getFormPublisher(): any;
65
74
  updateDataValue(): void;
66
- handleChange(e?: any): void;
67
- handleBlur(e?: any): void;
75
+ handleChange(e?: Event | undefined): void;
76
+ handleBlur(e?: Event | undefined): void;
68
77
  getValueForFormPublisher(): any;
78
+ focus?: (() => void) | undefined;
79
+ shadowRoot?: ShadowRoot | undefined;
69
80
  error: boolean;
70
81
  autofocus: boolean;
71
82
  required: boolean;
72
83
  disabled: true | null;
73
84
  formDataProvider: string;
74
- _value: any;
75
- value: any;
85
+ ariaLabelledby?: string | undefined;
86
+ ariaLabel?: string | undefined;
87
+ _value: string | null;
88
+ value: string | null;
76
89
  _name: string;
77
90
  name: string;
78
91
  props: any;
@@ -100,15 +113,39 @@ declare const Checkbox_base: {
100
113
  hasAttribute(attributeName: String): boolean;
101
114
  disconnectedCallback(): void;
102
115
  };
103
- } & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/FormElement").FormElementInterface) & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface) & typeof LitElement;
116
+ } & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/FormElement").FormElementInterface) & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<any>) & typeof LitElement;
117
+ /**
118
+ * ### Le composent sonic-checkbox étend les mixins FormCheckable, FormInput, FormElement et Subscriber
119
+ * **FormElement :**
120
+ * * La propriété value est remplie automatiquement a l'aide de l'attribut name renseigné, ceci en prenant la valeur de la propriété du même nom dans les données du dataprovider associé.
121
+ * * Par défault lorsque modifie l'input, la valeur est également mise à jour via le même dataprovider
122
+ * * On peut cependant décider de mettre à jour la donnée à une autre adresse en renseigne l'attribut *formDataProvider*.
123
+ * * Par conséquent on peut par exemple le lier à un composant *queue* (via sa propriété *dataFilterProvider*) de manière à appeller en auto une api avec des filtres.
124
+ * * **FormInput **
125
+ * Uniquement des propriétés classiques d'un input HTML. La prise en compte est ici partielle, par exemple les propriétés *placeholder*, *readonly*, *pattern*, *min* et *max* n'ont pas de sens pour un checkbox.
126
+ * **FormCheckable :**
127
+ * * La propriété checked mise à true si la valeur de la propriété du même nom dans les données du dataprovider associé contient un propriété checked.
128
+ * **Comportements :**
129
+ * * multiple (par défaut):
130
+ * - on peut cocher plusieurs checkbox ayant le même *name*.
131
+ * - la valeur enregistrée dans la propriété nommé du même nom dans formDataProvider est un tableau avec les *value* des cases cochées ayant le même *name*.
132
+ * * unique (Ajouter l'attribute unique au composant a l'intégration):
133
+ * - on ne peut cocher qu'une seule checkbox ayant le même *name*.
134
+ * * radio (Ajouter l'attribute radio au composant a l'intégration):
135
+ * Comme unique, mais on ne peut pas décocher la case sauf en en cochant une autre, comme un bouton radio.
136
+ */
104
137
  export declare class Checkbox extends Checkbox_base {
105
138
  static styles: CSSResultGroup[];
106
139
  touched: boolean;
107
140
  iconName: string;
108
- slotDescriptionNodes: Array<Node>;
141
+ indeterminateIconName: string;
109
142
  hasDescription: boolean;
110
- updated(): void;
143
+ hasLabel: boolean;
144
+ slotLabelNodes: Array<Node>;
145
+ slotDescriptionNodes: Array<Node>;
111
146
  connectedCallback(): void;
147
+ willUpdate(changedProperties: PropertyValues): void;
148
+ hasSlotOrProps(): void;
112
149
  render(): import("lit-html").TemplateResult<1>;
113
150
  }
114
151
  export {};
@@ -14,6 +14,7 @@ import FormCheckable from "@supersoniks/concorde/core/mixins/FormCheckable";
14
14
  import "@supersoniks/concorde/core/components/ui/icon/icon";
15
15
  import { unsafeHTML } from "lit/directives/unsafe-html.js";
16
16
  import { fontSize } from "@supersoniks/concorde/core/components/ui/_css/size";
17
+ const tagName = "sonic-checkbox";
17
18
  /**
18
19
  * ### Le composent sonic-checkbox étend les mixins FormCheckable, FormInput, FormElement et Subscriber
19
20
  * **FormElement :**
@@ -34,30 +35,38 @@ import { fontSize } from "@supersoniks/concorde/core/components/ui/_css/size";
34
35
  * * radio (Ajouter l'attribute radio au composant a l'intégration):
35
36
  * Comme unique, mais on ne peut pas décocher la case sauf en en cochant une autre, comme un bouton radio.
36
37
  */
37
- const tagName = "sonic-checkbox";
38
38
  let Checkbox = class Checkbox extends FormCheckable(FormInput(FormElement(Subscriber(LitElement)))) {
39
39
  constructor() {
40
40
  super(...arguments);
41
41
  this.touched = false;
42
42
  this.iconName = "check";
43
+ this.indeterminateIconName = "minus-small";
43
44
  this.hasDescription = false;
44
- }
45
- updated() {
46
- var _a;
47
- this.hasDescription = this.description || ((_a = this.slotDescriptionNodes) === null || _a === void 0 ? void 0 : _a.length) ? true : false;
45
+ this.hasLabel = false;
48
46
  }
49
47
  connectedCallback() {
50
48
  this.type = "checkbox";
49
+ this.hasSlotOrProps();
51
50
  super.connectedCallback();
52
51
  }
52
+ willUpdate(changedProperties) {
53
+ this.hasSlotOrProps();
54
+ super.willUpdate(changedProperties);
55
+ }
56
+ hasSlotOrProps() {
57
+ var _a, _b;
58
+ this.hasLabel = this.label || ((_a = this.slotLabelNodes) === null || _a === void 0 ? void 0 : _a.length) ? true : false;
59
+ this.hasDescription = this.description || ((_b = this.slotDescriptionNodes) === null || _b === void 0 ? void 0 : _b.length) ? true : false;
60
+ }
53
61
  render() {
54
- let labelStarSuffix = this.label && this.required && this.label.indexOf("*") == -1 ? " *" : "";
62
+ //let labelStarSuffix = this.label && this.required && this.label.indexOf("*") == -1 ? " *" : "";
55
63
  return html `
56
64
  <label class="checkbox-container ${this.disabled ? "disabled" : ""}">
65
+
57
66
  <span class="icon-container">
58
67
  <input
59
68
  type="${this.type}"
60
- @change=${this.handleChange}
69
+ @click=${this.handleChange}
61
70
  @blur=${this.handleBlur}
62
71
  ?required=${this.required}
63
72
  .disabled=${ifDefined(this.disabled)}
@@ -65,16 +74,20 @@ let Checkbox = class Checkbox extends FormCheckable(FormInput(FormElement(Subscr
65
74
  .name=${this.name}
66
75
  .value=${this.value}
67
76
  ?autofocus=${this.autofocus}
77
+ aria-label=${ifDefined(this.ariaLabel)}
78
+ aria-labelledby=${ifDefined(this.ariaLabelledby)}
68
79
  />
69
- <sonic-icon name="${this.iconName}" class="sc-input-icon"></sonic-icon>
80
+ <sonic-icon name="${this.checked == "indeterminate" ? this.indeterminateIconName : this.iconName}" class="sc-input-icon"></sonic-icon>
70
81
  </span>
71
- <div class="checkbox-text">
72
- ${this.label ? unsafeHTML(this.label + labelStarSuffix) : ""}
73
- <slot></slot>
74
- <slot name="description" class="${this.hasDescription ? "description" : "hidden"} ">
75
- ${this.description ? html `${unsafeHTML(this.description)}` : ""}
76
- </slot>
77
- </div>
82
+
83
+ <div class="checkbox-text ${!this.hasDescription && !this.hasLabel ? "hidden" : "checkbox-text"}">
84
+ ${this.label ? unsafeHTML(this.label /*+ labelStarSuffix*/) : ""}
85
+ <slot @slotchange=${this.hasSlotOrProps}></slot>
86
+ <slot @slotchange=${this.hasSlotOrProps} name="description" class="${this.hasDescription ? "description" : "hidden"} ">
87
+ ${this.description ? html `${unsafeHTML(this.description)}` : ""}
88
+ </slot>
89
+ </div>
90
+ </label>
78
91
  </label>
79
92
  `;
80
93
  }
@@ -84,7 +97,9 @@ Checkbox.styles = [
84
97
  css `
85
98
  :host {
86
99
  --sc-checkbox-border-width: var(--sc-form-border-width);
87
- --sc-checkbox-border-color: transparent;
100
+ --sc-checkbox-border-color: var(--sc-input-border-color);
101
+ --sc-checkbox-bg: var(--sc-input-bg);
102
+ --sc-checkbox-color: transparent;
88
103
  }
89
104
 
90
105
  * {
@@ -118,7 +133,7 @@ Checkbox.styles = [
118
133
  transition: 0.2s;
119
134
  outline: none;
120
135
  margin: 0;
121
- background-color: var(--sc-base-200);
136
+ background-color: var(--sc-checkbox-bg);
122
137
  border: var(--sc-checkbox-border-width) solid var(--sc-checkbox-border-color);
123
138
  }
124
139
 
@@ -138,7 +153,7 @@ Checkbox.styles = [
138
153
  left: 50%;
139
154
  transform: translateX(-50%) translateY(-50%) scale(0);
140
155
  transition: transform 0.2s ease-in-out;
141
- color: var(--sc-primary-content);
156
+ color: var(--sc-checkbox-color);
142
157
  }
143
158
 
144
159
  /* .checkbox-text {
@@ -154,12 +169,13 @@ Checkbox.styles = [
154
169
 
155
170
  /*Active */
156
171
  input:checked,
157
- input[checked="true"] {
158
- background: var(--sc-primary);
172
+ input[checked] {
173
+ --sc-checkbox-border-color: var(--sc-primary);
174
+ --sc-checkbox-bg: var(--sc-primary);
159
175
  }
160
-
161
176
  input:checked + sonic-icon,
162
- input[checked="true"] + sonic-icon {
177
+ input[checked] + sonic-icon {
178
+ --sc-checkbox-color: var(--sc-primary-content);
163
179
  transform: translateX(-50%) translateY(-50%) scale(1);
164
180
  }
165
181
  /*DISABLED */
@@ -174,6 +190,11 @@ Checkbox.styles = [
174
190
  opacity: 0.6;
175
191
  }
176
192
 
193
+ /*INPUT HOVER*/
194
+ :host(:not([disabled])) label:hover input {
195
+ filter: brightness(0.97);
196
+ }
197
+
177
198
  ::slotted(a) {
178
199
  color: inherit;
179
200
  text-decoration: underline !important;
@@ -205,17 +226,21 @@ __decorate([
205
226
  property({ type: String })
206
227
  ], Checkbox.prototype, "iconName", void 0);
207
228
  __decorate([
208
- queryAssignedNodes({ slot: "description" })
209
- ], Checkbox.prototype, "slotDescriptionNodes", void 0);
229
+ property({ type: String })
230
+ ], Checkbox.prototype, "indeterminateIconName", void 0);
210
231
  __decorate([
211
232
  property({ type: Boolean })
212
233
  ], Checkbox.prototype, "hasDescription", void 0);
234
+ __decorate([
235
+ property({ type: Boolean })
236
+ ], Checkbox.prototype, "hasLabel", void 0);
237
+ __decorate([
238
+ queryAssignedNodes()
239
+ ], Checkbox.prototype, "slotLabelNodes", void 0);
240
+ __decorate([
241
+ queryAssignedNodes({ slot: "description" })
242
+ ], Checkbox.prototype, "slotDescriptionNodes", void 0);
213
243
  Checkbox = __decorate([
214
244
  customElement(tagName)
215
245
  ], Checkbox);
216
246
  export { Checkbox };
217
- //Ajout pour Storybook
218
- try {
219
- customElements.define(tagName, Checkbox);
220
- }
221
- catch (e) { }
@@ -1 +1,3 @@
1
+ export declare const label: import("lit").CSSResult;
2
+ export declare const description: import("lit").CSSResult;
1
3
  export declare const formControl: import("lit").CSSResult;