@supersoniks/concorde 1.1.42 → 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 (182) hide show
  1. package/components.js +2 -3
  2. package/concorde-core.bundle.js +37 -35
  3. package/concorde-core.es.js +5081 -4317
  4. package/core/_types/types.d.ts +26 -0
  5. package/core/_types/types.js +1 -0
  6. package/core/components/functional/date/date.d.ts +13 -5
  7. package/core/components/functional/date/date.js +48 -29
  8. package/core/components/functional/example/example.d.ts +1 -1
  9. package/core/components/functional/example/example.js +1 -1
  10. package/core/components/functional/fetch/fetch.d.ts +40 -3
  11. package/core/components/functional/fetch/fetch.js +2 -6
  12. package/core/components/functional/functional.d.ts +2 -0
  13. package/core/components/functional/functional.js +2 -0
  14. package/core/components/functional/if/if.d.ts +3 -0
  15. package/core/components/functional/if/if.js +6 -12
  16. package/core/components/functional/if/if.test.d.ts +1 -0
  17. package/core/components/functional/if/if.test.js +44 -0
  18. package/core/components/functional/list/list.d.ts +32 -8
  19. package/core/components/functional/list/list.js +33 -40
  20. package/core/components/functional/mix/mix.d.ts +22 -0
  21. package/core/components/functional/mix/mix.js +99 -0
  22. package/core/components/functional/queue/queue.d.ts +16 -3
  23. package/core/components/functional/queue/queue.js +71 -15
  24. package/core/components/functional/router/redirect.d.ts +10 -1
  25. package/core/components/functional/router/redirect.js +5 -6
  26. package/core/components/functional/router/router.d.ts +15 -1
  27. package/core/components/functional/router/router.js +1 -6
  28. package/core/components/functional/sdui/SDUIDescriptorTransformer.d.ts +1 -1
  29. package/core/components/functional/sdui/SDUIDescriptorTransformer.js +24 -12
  30. package/core/components/functional/sdui/default-library.json +108 -0
  31. package/core/components/functional/sdui/sdui-utils.d.ts +5 -0
  32. package/core/components/functional/sdui/sdui-utils.js +63 -0
  33. package/core/components/functional/sdui/sdui.d.ts +16 -9
  34. package/core/components/functional/sdui/sdui.js +52 -25
  35. package/core/components/functional/sdui/types.d.ts +4 -2
  36. package/core/components/functional/states/states.d.ts +19 -3
  37. package/core/components/functional/states/states.js +7 -12
  38. package/core/components/functional/submit/submit.d.ts +16 -1
  39. package/core/components/functional/submit/submit.js +87 -17
  40. package/core/components/functional/subscriber/subscriber.d.ts +4 -1
  41. package/core/components/functional/subscriber/subscriber.js +1 -6
  42. package/core/components/functional/value/value.d.ts +7 -0
  43. package/core/components/functional/value/value.js +26 -0
  44. package/core/components/ui/_css/scroll.js +6 -7
  45. package/core/components/ui/_css/size.d.ts +1 -0
  46. package/core/components/ui/_css/size.js +3 -1
  47. package/core/components/ui/alert/alert.d.ts +2 -2
  48. package/core/components/ui/alert/alert.js +11 -16
  49. package/core/components/ui/badge/badge.d.ts +3 -1
  50. package/core/components/ui/badge/badge.js +36 -22
  51. package/core/components/ui/button/button.d.ts +23 -20
  52. package/core/components/ui/button/button.js +59 -42
  53. package/core/components/ui/captcha/captcha.d.ts +14 -2
  54. package/core/components/ui/captcha/captcha.js +17 -12
  55. package/core/components/ui/card/card-footer.js +1 -8
  56. package/core/components/ui/card/card-header-descripton.js +3 -9
  57. package/core/components/ui/card/card-header.js +1 -6
  58. package/core/components/ui/card/card-main.js +0 -5
  59. package/core/components/ui/card/card.d.ts +1 -1
  60. package/core/components/ui/card/card.js +28 -12
  61. package/core/components/ui/divider/divider.d.ts +2 -0
  62. package/core/components/ui/divider/divider.js +43 -16
  63. package/core/components/ui/form/checkbox/checkbox.d.ts +53 -16
  64. package/core/components/ui/form/checkbox/checkbox.js +53 -28
  65. package/core/components/ui/form/css/form-control.d.ts +2 -0
  66. package/core/components/ui/form/css/form-control.js +145 -67
  67. package/core/components/ui/form/fieldset/fieldset.d.ts +8 -1
  68. package/core/components/ui/form/fieldset/fieldset.js +45 -8
  69. package/core/components/ui/form/fieldset/legend-description.js +0 -5
  70. package/core/components/ui/form/fieldset/legend.js +3 -6
  71. package/core/components/ui/form/form-actions/form-actions.d.ts +2 -0
  72. package/core/components/ui/form/form-actions/form-actions.js +26 -11
  73. package/core/components/ui/form/form-layout/form-layout.d.ts +5 -2
  74. package/core/components/ui/form/form-layout/form-layout.js +31 -9
  75. package/core/components/ui/form/input/input.d.ts +15 -18
  76. package/core/components/ui/form/input/input.js +87 -52
  77. package/core/components/ui/form/input/password-helper.d.ts +1 -1
  78. package/core/components/ui/form/input/password-helper.js +3 -2
  79. package/core/components/ui/form/input/same-value-helper.d.ts +1 -1
  80. package/core/components/ui/form/input/same-value-helper.js +1 -0
  81. package/core/components/ui/form/input-autocomplete/input-autocomplete.d.ts +2 -3
  82. package/core/components/ui/form/input-autocomplete/input-autocomplete.js +2 -6
  83. package/core/components/ui/form/radio/radio.d.ts +6 -0
  84. package/core/components/ui/form/radio/radio.js +7 -12
  85. package/core/components/ui/form/select/select.d.ts +23 -7
  86. package/core/components/ui/form/select/select.js +69 -38
  87. package/core/components/ui/form/textarea/textarea.d.ts +13 -13
  88. package/core/components/ui/form/textarea/textarea.js +29 -36
  89. package/core/components/ui/group/group.d.ts +11 -1
  90. package/core/components/ui/group/group.js +79 -17
  91. package/core/components/ui/icon/icon.d.ts +10 -3
  92. package/core/components/ui/icon/icon.js +16 -15
  93. package/core/components/ui/icon/icons.js +11 -8
  94. package/core/components/ui/icon/icons.json +1 -1
  95. package/core/components/ui/image/image.js +0 -5
  96. package/core/components/ui/link/link.d.ts +1 -1
  97. package/core/components/ui/link/link.js +2 -6
  98. package/core/components/ui/loader/loader.js +2 -8
  99. package/core/components/ui/menu/menu-item.js +4 -9
  100. package/core/components/ui/menu/menu.d.ts +9 -1
  101. package/core/components/ui/menu/menu.js +183 -27
  102. package/core/components/ui/modal/modal-actions.js +1 -6
  103. package/core/components/ui/modal/modal-close.d.ts +1 -0
  104. package/core/components/ui/modal/modal-close.js +14 -10
  105. package/core/components/ui/modal/modal-content.js +0 -5
  106. package/core/components/ui/modal/modal-subtitle.js +2 -6
  107. package/core/components/ui/modal/modal-title.js +0 -5
  108. package/core/components/ui/modal/modal.d.ts +7 -7
  109. package/core/components/ui/modal/modal.js +36 -36
  110. package/core/components/ui/pop/pop.d.ts +6 -5
  111. package/core/components/ui/pop/pop.js +44 -44
  112. package/core/components/ui/progress/progress.js +34 -32
  113. package/core/components/ui/table/table-caption.js +5 -10
  114. package/core/components/ui/table/table-tbody.js +10 -14
  115. package/core/components/ui/table/table-td.d.ts +2 -0
  116. package/core/components/ui/table/table-td.js +8 -5
  117. package/core/components/ui/table/table-tfoot.js +5 -7
  118. package/core/components/ui/table/table-th.d.ts +2 -0
  119. package/core/components/ui/table/table-th.js +12 -9
  120. package/core/components/ui/table/table-thead.js +1 -6
  121. package/core/components/ui/table/table-tr.js +4 -6
  122. package/core/components/ui/table/table.d.ts +0 -3
  123. package/core/components/ui/table/table.js +14 -31
  124. package/core/components/ui/taxonomy/taxonomy.d.ts +6 -3
  125. package/core/components/ui/taxonomy/taxonomy.js +9 -9
  126. package/core/components/ui/theme/theme-collection/core-variables.js +13 -11
  127. package/core/components/ui/theme/theme-collection/dark.js +1 -1
  128. package/core/components/ui/theme/theme.d.ts +1 -6
  129. package/core/components/ui/theme/theme.js +7 -36
  130. package/core/components/ui/toast/message-subscriber.d.ts +13 -7
  131. package/core/components/ui/toast/toast-item.js +1 -1
  132. package/core/components/ui/toast/toast.d.ts +2 -1
  133. package/core/components/ui/toast/toast.js +29 -14
  134. package/core/components/ui/tooltip/tooltip.d.ts +1 -0
  135. package/core/components/ui/tooltip/tooltip.js +35 -14
  136. package/core/components/ui/ui.js +0 -3
  137. package/core/core.js +5 -6
  138. package/core/mixins/Fetcher.d.ts +19 -10
  139. package/core/mixins/Fetcher.js +26 -10
  140. package/core/mixins/FormCheckable.d.ts +17 -8
  141. package/core/mixins/FormCheckable.js +177 -22
  142. package/core/mixins/FormElement.d.ts +12 -7
  143. package/core/mixins/FormElement.js +42 -26
  144. package/core/mixins/FormInput.d.ts +8 -4
  145. package/core/mixins/FormInput.js +4 -3
  146. package/core/mixins/Subscriber.d.ts +7 -5
  147. package/core/mixins/Subscriber.js +34 -32
  148. package/core/utils/Arrays.d.ts +15 -15
  149. package/core/utils/DataBindObserver.d.ts +16 -9
  150. package/core/utils/DataBindObserver.js +23 -28
  151. package/core/utils/Electron.d.ts +5 -1
  152. package/core/utils/Electron.js +4 -2
  153. package/core/utils/HTML.d.ts +9 -2
  154. package/core/utils/HTML.js +22 -3
  155. package/core/utils/LocationHandler.d.ts +6 -5
  156. package/core/utils/LocationHandler.js +19 -8
  157. package/core/utils/Objects.d.ts +7 -4
  158. package/core/utils/Objects.js +28 -6
  159. package/core/utils/{PublisherProxy.d.mts → PublisherProxy.d.ts} +40 -31
  160. package/core/utils/{PublisherProxy.mjs → PublisherProxy.js} +54 -28
  161. package/core/utils/Utils.d.ts +3 -0
  162. package/core/utils/Utils.js +18 -0
  163. package/core/utils/api.d.ts +39 -7
  164. package/core/utils/api.js +45 -32
  165. package/img/concorde-logo.svg +1 -0
  166. package/img/concorde.png +0 -0
  167. package/img/concorde_def.png +0 -0
  168. package/mixins.d.ts +36 -18
  169. package/mixins.js +3 -4
  170. package/package.json +45 -10
  171. package/svg/regular/plane.svg +1 -0
  172. package/svg/solid/plane.svg +1 -0
  173. package/test-utils/TestUtils.d.ts +4 -0
  174. package/test-utils/TestUtils.js +12 -0
  175. package/utils.d.ts +3 -1
  176. package/utils.js +7 -5
  177. package/core/components/functional/configuration/configuration.d.ts +0 -5
  178. package/core/components/functional/configuration/configuration.js +0 -22
  179. package/core/components/ui/tabs/tab.d.ts +0 -6
  180. package/core/components/ui/tabs/tab.js +0 -46
  181. package/core/components/ui/tabs/tabs.d.ts +0 -15
  182. package/core/components/ui/tabs/tabs.js +0 -129
@@ -6,7 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  };
7
7
  import { html, LitElement, css } from "lit";
8
8
  import { styleMap } from "lit/directives/style-map.js";
9
- import { customElement, property, queryAssignedElements, state } from "lit/decorators.js";
9
+ import { customElement, property, queryAssignedElements, state, query } from "lit/decorators.js";
10
10
  import "@supersoniks/concorde/core/components/ui/menu/menu-item";
11
11
  const tagName = "sonic-menu";
12
12
  let MenuItems = class MenuItems extends LitElement {
@@ -28,18 +28,26 @@ let MenuItems = class MenuItems extends LitElement {
28
28
  */
29
29
  this.shadow = null;
30
30
  this.moreShape = "circle";
31
+ this.scrollable = false;
32
+ this.observer = null;
31
33
  /**
32
34
  * Propriété min-width du bouton
33
35
  */
34
36
  this.minWidth = "0";
35
37
  this.hasMoreElements = false;
38
+ this.updateIsScollable = () => {
39
+ if (this.scrollable) {
40
+ this.initScrollable();
41
+ this.setScrollShadow(this, this.direction);
42
+ }
43
+ };
36
44
  }
37
45
  checkIfMore() {
38
46
  var _a;
39
47
  this.hasMoreElements = !!((_a = this.moreElements) === null || _a === void 0 ? void 0 : _a.length);
40
48
  }
41
49
  updated(_changedProperties) {
42
- const moreBtn = this.querySelector('.more-btn');
50
+ const moreBtn = this.querySelector(".more-btn");
43
51
  if (this.size && moreBtn) {
44
52
  moreBtn.setAttribute("size", this.size);
45
53
  }
@@ -53,6 +61,85 @@ let MenuItems = class MenuItems extends LitElement {
53
61
  }
54
62
  mainSlotChange() {
55
63
  this.setChildrenSize(this.menuChildren);
64
+ this.updateIsScollable();
65
+ }
66
+ connectedCallback() {
67
+ this.observer = new ResizeObserver(this.updateIsScollable);
68
+ // observe if menu elements are overflowing and initiate scrollable
69
+ this.observer.observe(this);
70
+ super.connectedCallback();
71
+ }
72
+ disconnectedCallback() {
73
+ var _a;
74
+ (_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
75
+ super.disconnectedCallback();
76
+ }
77
+ initScrollable() {
78
+ const tabsMenu = this;
79
+ let isDown = false;
80
+ let startX;
81
+ let scrollLeft;
82
+ if (this.scrollable) {
83
+ tabsMenu.addEventListener("mousedown", (e) => {
84
+ isDown = true;
85
+ tabsMenu.classList.add("active");
86
+ startX = e.pageX - tabsMenu.offsetLeft;
87
+ scrollLeft = tabsMenu.scrollLeft;
88
+ });
89
+ tabsMenu.addEventListener("mouseleave", () => {
90
+ isDown = false;
91
+ tabsMenu.classList.remove("active");
92
+ });
93
+ tabsMenu.addEventListener("mouseup", () => {
94
+ isDown = false;
95
+ tabsMenu.classList.remove("active");
96
+ });
97
+ tabsMenu.addEventListener("mousemove", (e) => {
98
+ if (!isDown)
99
+ return;
100
+ e.preventDefault();
101
+ const x = e.pageX - tabsMenu.offsetLeft;
102
+ const walk = (x - startX) * 1.5; //scroll-fast
103
+ tabsMenu.scrollLeft = scrollLeft - walk;
104
+ this.setScrollShadow(tabsMenu, this.direction);
105
+ });
106
+ tabsMenu.addEventListener("scroll", (e) => {
107
+ e.preventDefault();
108
+ // const delta = Math.sign(e.deltaY);
109
+ // tabsMenu.scrollLeft += delta * 50;
110
+ this.setScrollShadow(tabsMenu, this.direction);
111
+ });
112
+ }
113
+ }
114
+ setScrollShadow(target, direction) {
115
+ if (direction == "row") {
116
+ if (target.scrollLeft > 0) {
117
+ this.classList.add("shadow-left");
118
+ }
119
+ else {
120
+ this.classList.remove("shadow-left");
121
+ }
122
+ if (target.scrollLeft < target.scrollWidth - target.offsetWidth) {
123
+ this.classList.add("shadow-right");
124
+ }
125
+ else {
126
+ this.classList.remove("shadow-right");
127
+ }
128
+ }
129
+ else if (direction == "column") {
130
+ if (target.scrollTop > 0) {
131
+ this.classList.add("shadow-top");
132
+ }
133
+ else {
134
+ this.classList.remove("shadow-top");
135
+ }
136
+ if (target.scrollTop < target.scrollHeight - (target.offsetHeight + 1)) {
137
+ this.classList.add("shadow-bottom");
138
+ }
139
+ else {
140
+ this.classList.remove("shadow-bottom");
141
+ }
142
+ }
56
143
  }
57
144
  setChildrenSize(menuItems) {
58
145
  menuItems.forEach((elt) => {
@@ -63,7 +150,7 @@ let MenuItems = class MenuItems extends LitElement {
63
150
  elt.setAttribute("align", this.align);
64
151
  }
65
152
  if (this.direction == "row") {
66
- if (elt.getAttribute('shape') == "block") {
153
+ if (elt.getAttribute("shape") == "block") {
67
154
  elt.setAttribute("shape", "default");
68
155
  }
69
156
  }
@@ -73,34 +160,34 @@ let MenuItems = class MenuItems extends LitElement {
73
160
  const menuStyles = {
74
161
  minWidth: this.minWidth,
75
162
  flexDirection: this.direction,
76
- gap: this.gap
163
+ gap: this.gap,
77
164
  };
78
165
  const isMenuRow = this.direction == "row";
79
166
  const popStyles = {
80
- display: 'block',
81
- alignSelf: isMenuRow ? 'center' : 'flex-start',
82
- justifySelf: 'center',
83
- flexDirection: this.direction
167
+ display: "block",
168
+ alignSelf: isMenuRow ? "center" : "flex-start",
169
+ justifySelf: "center",
170
+ flexDirection: this.direction,
84
171
  };
85
172
  const popBtnStyles = {
86
- marginLeft: isMenuRow ? '' : '.55em'
173
+ marginLeft: isMenuRow ? "" : ".55em",
87
174
  };
88
175
  return html `<menu part="menu" class="shadowable" style=${styleMap(menuStyles)}>
89
- <slot @slotchange=${this.mainSlotChange}></slot>
90
- <sonic-pop style=${styleMap(popStyles)} class=${!this.hasMoreElements ? 'hidden' : ''}>
91
- <sonic-menu-item style=${styleMap(popBtnStyles)} class="more-btn" shape=${this.moreShape} align="center" >
92
- <sonic-icon size="xl" name=${isMenuRow ? "more-vert" : "more-horiz"} ></sonic-icon>
93
- </sonic-menu-item>
94
- <slot name="more" @slotchange=${this.checkIfMore} slot="content"></slot>
95
- </sonic-pop>
96
- </menu>`;
176
+ <slot @slotchange=${this.mainSlotChange}></slot>
177
+ <sonic-pop style=${styleMap(popStyles)} class=${!this.hasMoreElements ? "hidden" : ""}>
178
+ <sonic-menu-item style=${styleMap(popBtnStyles)} class="more-btn" shape=${this.moreShape} align="center">
179
+ <sonic-icon size="xl" name=${isMenuRow ? "more-vert" : "more-horiz"}></sonic-icon>
180
+ </sonic-menu-item>
181
+ <slot name="more" @slotchange=${this.checkIfMore} slot="content"></slot>
182
+ </sonic-pop>
183
+ </menu>`;
97
184
  }
98
185
  };
99
186
  MenuItems.styles = [
100
187
  css `
101
188
  :host {
102
189
  display: block;
103
- --sc-menu-gap:.15rem;
190
+ --sc-menu-gap: 0.15rem;
104
191
  }
105
192
 
106
193
  :host > menu {
@@ -109,9 +196,9 @@ MenuItems.styles = [
109
196
  margin: 0;
110
197
  padding: 0.35em;
111
198
  }
112
-
199
+
113
200
  .hidden {
114
- display:none !important;
201
+ display: none !important;
115
202
  }
116
203
 
117
204
  /*OMBRE*/
@@ -128,11 +215,79 @@ MenuItems.styles = [
128
215
  :host([shadow="lg"]) .shadowable {
129
216
  box-shadow: var(--sc-shadow-lg);
130
217
  }
131
-
218
+
132
219
  :host([shadow="none"]) .shadowable {
133
220
  box-shadow: none;
134
221
  }
135
-
222
+
223
+ /* SCROLLABLE*/
224
+ :host([scrollable]) {
225
+ scrollbar-width: none;
226
+ -ms-overflow-style: none;
227
+ }
228
+ :host([scrollable]) menu > * {
229
+ scroll-snap-align: start;
230
+ white-space: nowrap;
231
+ }
232
+ :host([scrollable][direction="row"]) {
233
+ overflow-x: scroll;
234
+ scroll-snap-type: x mandatory;
235
+ }
236
+ :host([scrollable][direction="column"]) {
237
+ overflow-y: scroll;
238
+ scroll-snap-type: y mandatory;
239
+ }
240
+ :host([scrollable])::-webkit-scrollbar {
241
+ display: none !important;
242
+ }
243
+ :host([scrollable][direction="row"].shadow-right) {
244
+ -webkit-mask-image: linear-gradient(to left, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 10%);
245
+ mask-image: linear-gradient(to left, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 10%);
246
+ }
247
+ :host([scrollable][direction="row"].shadow-left) {
248
+ -webkit-mask-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 10%);
249
+ mask-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 10%);
250
+ }
251
+ :host([scrollable][direction="row"].shadow-left.shadow-right) {
252
+ -webkit-mask-image: linear-gradient(
253
+ to right,
254
+ rgba(0, 0, 0, 0) 0%,
255
+ rgba(0, 0, 0, 1) 10%,
256
+ rgba(0, 0, 0, 1) 90%,
257
+ rgba(0, 0, 0, 0) 100%
258
+ );
259
+ mask-image: linear-gradient(
260
+ to right,
261
+ rgba(0, 0, 0, 0) 0%,
262
+ rgba(0, 0, 0, 1) 10%,
263
+ rgba(0, 0, 0, 1) 90%,
264
+ rgba(0, 0, 0, 0) 100%
265
+ );
266
+ }
267
+ :host([scrollable][direction="column"].shadow-top) {
268
+ -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 10%);
269
+ mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 10%);
270
+ }
271
+ :host([scrollable][direction="column"].shadow-bottom) {
272
+ -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 10%);
273
+ mask-image: linear-gradient(to top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 10%);
274
+ }
275
+ :host([scrollable][direction="column"].shadow-top.shadow-bottom) {
276
+ -webkit-mask-image: linear-gradient(
277
+ to top,
278
+ rgba(0, 0, 0, 0) 0%,
279
+ rgba(0, 0, 0, 1) 10%,
280
+ rgba(0, 0, 0, 1) 90%,
281
+ rgba(0, 0, 0, 0) 100%
282
+ );
283
+ mask-image: linear-gradient(
284
+ to bottom,
285
+ rgba(0, 0, 0, 0) 0%,
286
+ rgba(0, 0, 0, 1) 10%,
287
+ rgba(0, 0, 0, 1) 90%,
288
+ rgba(0, 0, 0, 0) 100%
289
+ );
290
+ }
136
291
  `,
137
292
  ];
138
293
  __decorate([
@@ -153,9 +308,15 @@ __decorate([
153
308
  __decorate([
154
309
  property({ type: String })
155
310
  ], MenuItems.prototype, "moreShape", void 0);
311
+ __decorate([
312
+ property({ type: Boolean })
313
+ ], MenuItems.prototype, "scrollable", void 0);
156
314
  __decorate([
157
315
  property({ type: String })
158
316
  ], MenuItems.prototype, "minWidth", void 0);
317
+ __decorate([
318
+ query("menu")
319
+ ], MenuItems.prototype, "menu", void 0);
159
320
  __decorate([
160
321
  queryAssignedElements({ selector: "sonic-menu-item" })
161
322
  ], MenuItems.prototype, "menuChildren", void 0);
@@ -169,8 +330,3 @@ MenuItems = __decorate([
169
330
  customElement(tagName)
170
331
  ], MenuItems);
171
332
  export { MenuItems };
172
- //Ajout pour la creation du cem notamment pour Storybook
173
- try {
174
- customElements.define(tagName, MenuItems);
175
- }
176
- catch (e) { }
@@ -29,7 +29,7 @@ ModalActions.styles = [
29
29
  display: flex;
30
30
  gap: 0.5rem;
31
31
  margin-top: auto;
32
- padding-top: 1rem;
32
+ padding-top: 1.5rem;
33
33
  }
34
34
  `,
35
35
  ];
@@ -40,8 +40,3 @@ ModalActions = __decorate([
40
40
  customElement(tagName)
41
41
  ], ModalActions);
42
42
  export { ModalActions };
43
- //Ajout pour Storybook
44
- try {
45
- customElements.define(tagName, ModalActions);
46
- }
47
- catch (e) { }
@@ -1,6 +1,7 @@
1
1
  import { LitElement } from "lit";
2
2
  export declare class ModalClose extends LitElement {
3
3
  static styles: import("lit").CSSResult[];
4
+ reset?: string;
4
5
  render(): import("lit-html").TemplateResult<1>;
5
6
  handleClick(): void;
6
7
  }
@@ -5,11 +5,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  import { html, LitElement, css } from "lit";
8
- import { customElement } from "lit/decorators.js";
8
+ import { customElement, property } from "lit/decorators.js";
9
+ import { ifDefined } from "lit/directives/if-defined.js";
9
10
  const tagName = "sonic-modal-close";
10
11
  let ModalClose = class ModalClose extends LitElement {
11
12
  render() {
12
- return html `<sonic-button shape="circle" variant="ghost" @click=${this.handleClick}
13
+ return html `<sonic-button reset=${ifDefined(this.reset)} shape="circle" @click=${this.handleClick}
13
14
  ><sonic-icon name="cancel" size="lg"></sonic-icon
14
15
  ></sonic-button>`;
15
16
  }
@@ -21,19 +22,22 @@ let ModalClose = class ModalClose extends LitElement {
21
22
  ModalClose.styles = [
22
23
  css `
23
24
  :host {
24
- position: absolute;
25
- right: 0.6rem;
26
- top: 0.6rem;
25
+ position: sticky;
26
+ display: block;
27
+ align-self: flex-end;
28
+ height: 0;
29
+ top: 0;
30
+ padding-top: 0.5rem;
31
+ padding-right: 0.5rem;
32
+ transform: translate3d(calc(var(--sc-modal-px)), calc(-1 * var(--sc-modal-py)), 0);
27
33
  z-index: 20;
28
34
  }
29
35
  `,
30
36
  ];
37
+ __decorate([
38
+ property()
39
+ ], ModalClose.prototype, "reset", void 0);
31
40
  ModalClose = __decorate([
32
41
  customElement(tagName)
33
42
  ], ModalClose);
34
43
  export { ModalClose };
35
- //Ajout pour Storybook
36
- try {
37
- customElements.define(tagName, ModalClose);
38
- }
39
- catch (e) { }
@@ -23,8 +23,3 @@ ModalContent = __decorate([
23
23
  customElement(tagName)
24
24
  ], ModalContent);
25
25
  export { ModalContent };
26
- //Ajout pour Storybook
27
- try {
28
- customElements.define(tagName, ModalContent);
29
- }
30
- catch (e) { }
@@ -17,9 +17,10 @@ ModalSubTitle.styles = [
17
17
  :host {
18
18
  font-size: 1.1rem;
19
19
  display: block;
20
- text-transform: uppercase;
20
+ line-height: 1.1rem;
21
21
  line-height: var(--sc-headings-line-height);
22
22
  font-family: var(--sc-headings-font-family);
23
+ font-weight: var(--sc-headings-font-weight);
23
24
  }
24
25
  `,
25
26
  ];
@@ -27,8 +28,3 @@ ModalSubTitle = __decorate([
27
28
  customElement(tagName)
28
29
  ], ModalSubTitle);
29
30
  export { ModalSubTitle };
30
- //Ajout pour Storybook
31
- try {
32
- customElements.define(tagName, ModalSubTitle);
33
- }
34
- catch (e) { }
@@ -27,8 +27,3 @@ ModalTitle = __decorate([
27
27
  customElement(tagName)
28
28
  ], ModalTitle);
29
29
  export { ModalTitle };
30
- //Ajout pour Storybook
31
- try {
32
- customElements.define(tagName, ModalTitle);
33
- }
34
- catch (e) { }
@@ -1,17 +1,16 @@
1
- import { LitElement, nothing } from "lit";
1
+ import { LitElement, nothing, PropertyValues } from "lit";
2
2
  import "@supersoniks/concorde/core/components/ui/modal/modal-actions";
3
- import "@supersoniks/concorde/core/components/ui/modal/modal-title";
4
- import "@supersoniks/concorde/core/components/ui/modal/modal-subtitle";
5
- import "@supersoniks/concorde/core/components/ui/modal/modal-content";
6
3
  import "@supersoniks/concorde/core/components/ui/modal/modal-close";
4
+ import "@supersoniks/concorde/core/components/ui/modal/modal-content";
5
+ import "@supersoniks/concorde/core/components/ui/modal/modal-subtitle";
6
+ import "@supersoniks/concorde/core/components/ui/modal/modal-title";
7
7
  declare type ModalCreateOptions = {
8
8
  content?: string;
9
9
  };
10
- declare const Modal_base: (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface) & typeof LitElement;
10
+ declare const Modal_base: (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<any>) & typeof LitElement;
11
11
  export declare class Modal extends Modal_base {
12
12
  static styles: import("lit").CSSResult[];
13
- hideOnOverlayClick: boolean;
14
- hideOnEscape: boolean;
13
+ forceAction: boolean;
15
14
  align: "center" | "right" | "left";
16
15
  padding: string;
17
16
  maxWidth: string;
@@ -26,6 +25,7 @@ export declare class Modal extends Modal_base {
26
25
  static create(options: ModalCreateOptions): Modal;
27
26
  connectedCallback(): void;
28
27
  updated(): void;
28
+ willUpdate(_changedProperties: PropertyValues): void;
29
29
  render(): import("lit-html").TemplateResult<1> | typeof nothing;
30
30
  show(): void;
31
31
  hide(): void;
@@ -4,24 +4,24 @@ 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
- import { html, LitElement, css, nothing } from "lit";
8
- import { customElement, property, queryAssignedElements, query } from "lit/decorators.js";
9
- import Subscriber from "@supersoniks/concorde/core/mixins/Subscriber";
10
7
  import { animate, fadeIn, fadeOut } from "@lit-labs/motion";
11
- import { styleMap } from "lit/directives/style-map.js";
12
8
  import { customScroll } from "@supersoniks/concorde/core/components/ui/_css/scroll";
9
+ import Subscriber from "@supersoniks/concorde/core/mixins/Subscriber";
10
+ import { css, html, LitElement, nothing } from "lit";
11
+ import { customElement, property, query, queryAssignedElements } from "lit/decorators.js";
12
+ import { styleMap } from "lit/directives/style-map.js";
13
13
  import "@supersoniks/concorde/core/components/ui/modal/modal-actions";
14
- import "@supersoniks/concorde/core/components/ui/modal/modal-title";
15
- import "@supersoniks/concorde/core/components/ui/modal/modal-subtitle";
16
- import "@supersoniks/concorde/core/components/ui/modal/modal-content";
17
14
  import "@supersoniks/concorde/core/components/ui/modal/modal-close";
15
+ import "@supersoniks/concorde/core/components/ui/modal/modal-content";
16
+ import "@supersoniks/concorde/core/components/ui/modal/modal-subtitle";
17
+ import "@supersoniks/concorde/core/components/ui/modal/modal-title";
18
+ import { PublisherManager } from "@supersoniks/concorde/utils";
18
19
  const tagName = "sonic-modal";
19
20
  let Modal = class Modal extends Subscriber(LitElement) {
20
21
  constructor() {
21
22
  super(...arguments);
22
- this.hideOnOverlayClick = true;
23
- this.hideOnEscape = true;
24
- this.align = "center";
23
+ this.forceAction = false;
24
+ this.align = "left";
25
25
  this.padding = "var(--sc-modal-py) var(--sc-modal-px)";
26
26
  this.maxWidth = "var(--sc-modal-max-w) ";
27
27
  this.maxHeight = "var(--sc-modal-max-h) ";
@@ -41,6 +41,7 @@ let Modal = class Modal extends Subscriber(LitElement) {
41
41
  }
42
42
  connectedCallback() {
43
43
  super.connectedCallback();
44
+ this.handleFullsceen();
44
45
  }
45
46
  updated() {
46
47
  const currentModal = this;
@@ -51,10 +52,15 @@ let Modal = class Modal extends Subscriber(LitElement) {
51
52
  }, { once: true });
52
53
  });
53
54
  }
55
+ willUpdate(_changedProperties) {
56
+ if (_changedProperties.has("fullScreen")) {
57
+ this.handleFullsceen();
58
+ }
59
+ super.willUpdate(_changedProperties);
60
+ }
54
61
  render() {
55
62
  if (this.visible == false)
56
63
  return nothing;
57
- this.handleFullsceen();
58
64
  const modalStyles = {
59
65
  padding: this.padding,
60
66
  maxWidth: this.maxWidth,
@@ -99,7 +105,7 @@ let Modal = class Modal extends Subscriber(LitElement) {
99
105
 
100
106
  <div
101
107
  class="overlay"
102
- @click="${this.hideOnOverlayClick ? this.hide : ""}"
108
+ @click="${!this.forceAction ? this.hide : ""}"
103
109
  ${animate({
104
110
  keyframeOptions: {
105
111
  duration: 500,
@@ -121,6 +127,9 @@ let Modal = class Modal extends Subscriber(LitElement) {
121
127
  this.visible = false;
122
128
  (_a = this.modalElement) === null || _a === void 0 ? void 0 : _a.setAttribute("tabindex", "-1");
123
129
  this.dispatchEvent(new CustomEvent("hide"));
130
+ if (this.hasAttribute("resetDataProviderOnHide")) {
131
+ PublisherManager.get(this.getAttribute("resetDataProviderOnHide")).set({});
132
+ }
124
133
  }
125
134
  dispose() {
126
135
  this.hide();
@@ -130,7 +139,7 @@ let Modal = class Modal extends Subscriber(LitElement) {
130
139
  if (e.key === "Escape") {
131
140
  const modals = [...document.querySelectorAll(tagName)];
132
141
  modals.forEach((item) => {
133
- if (this.hideOnEscape == true) {
142
+ if (!this.forceAction) {
134
143
  item.hide();
135
144
  }
136
145
  });
@@ -152,11 +161,8 @@ Modal.styles = [
152
161
  :host {
153
162
  --sc-modal-py: 2.5rem;
154
163
  --sc-modal-px: 1.5rem;
155
- --sc-modal-content: var(--sc-base-content);
156
- --sc-modal-bg: var(--sc-base);
157
164
  --sc-modal-max-w: min(100vw, 64ch);
158
165
  --sc-modal-max-h: 80vh;
159
- --sc-modal-scrollbar-bg: var(--sc-base-300);
160
166
  --sc-modal-rounded: var(--sc-rounded-lg);
161
167
  }
162
168
 
@@ -170,7 +176,6 @@ Modal.styles = [
170
176
  left: 0;
171
177
  width: 100%;
172
178
  z-index: 990;
173
- text-align: center;
174
179
  align-items: center;
175
180
  justify-content: center;
176
181
  flex-direction: column;
@@ -178,18 +183,16 @@ Modal.styles = [
178
183
  pointer-events: none;
179
184
  }
180
185
 
181
-
182
186
  .modal-content {
183
- overflow-y: auto;
184
187
  display: flex;
185
188
  flex-direction: column;
186
- text-align: center;
187
- align-items: center;
188
189
  min-height: 10rem;
190
+ line-height: 1.25;
189
191
  }
190
192
 
191
193
  .modal {
192
194
  background: var(--sc-base);
195
+ color: var(--sc-base-content);
193
196
  width: 100%;
194
197
  box-shadow: var(--sc-shadow-lg);
195
198
  border-radius: var(--sc-modal-rounded) var(--sc-modal-rounded) 0 0;
@@ -199,7 +202,7 @@ Modal.styles = [
199
202
  }
200
203
 
201
204
  .overlay {
202
- background: var(--sc-base-200);
205
+ background: var(--sc-modal-overlay-bg, var(--sc-base-200));
203
206
  left: 0;
204
207
  top: 0;
205
208
  right: 0;
@@ -210,12 +213,12 @@ Modal.styles = [
210
213
  }
211
214
 
212
215
  ::slotted(sonic-modal-title) {
213
- margin-bottom: 1rem;
216
+ margin-bottom: 1.25rem;
214
217
  }
215
218
 
216
219
  ::slotted(sonic-modal-subtitle) {
217
- margin-top: -0.45rem;
218
- margin-bottom: 1rem;
220
+ margin-top: -0.9rem;
221
+ margin-bottom: 1.25rem;
219
222
  }
220
223
 
221
224
  @media (max-width: 767.5px) {
@@ -248,6 +251,11 @@ Modal.styles = [
248
251
  align-items: flex-start;
249
252
  }
250
253
 
254
+ :host([align="center"]) .modal-content {
255
+ text-align: center;
256
+ align-items: center;
257
+ }
258
+
251
259
  :host([align="right"]) .modal-content {
252
260
  text-align: right;
253
261
  align-items: flex-end;
@@ -260,11 +268,8 @@ Modal.styles = [
260
268
  `,
261
269
  ];
262
270
  __decorate([
263
- property({ type: Boolean, reflect: true })
264
- ], Modal.prototype, "hideOnOverlayClick", void 0);
265
- __decorate([
266
- property({ type: Boolean, reflect: true })
267
- ], Modal.prototype, "hideOnEscape", void 0);
271
+ property({ type: Boolean })
272
+ ], Modal.prototype, "forceAction", void 0);
268
273
  __decorate([
269
274
  property({ type: String, reflect: true })
270
275
  ], Modal.prototype, "align", void 0);
@@ -303,10 +308,5 @@ Modal = __decorate([
303
308
  ], Modal);
304
309
  export { Modal };
305
310
  if (typeof window !== "undefined") {
306
- let win = window;
307
- win.SonicModal = Modal;
308
- }
309
- try {
310
- customElements.define(tagName, Modal);
311
+ window.SonicModal = Modal;
311
312
  }
312
- catch (e) { }
@@ -1,23 +1,24 @@
1
- import { LitElement } from 'lit';
2
- declare type PopPlacement = 'bottom' | 'top' | 'right' | 'left';
1
+ import { LitElement } from "lit";
2
+ declare type PopPlacement = "bottom" | "top" | "right" | "left";
3
3
  export declare class Pop extends LitElement {
4
4
  static pops: Set<Pop>;
5
5
  static styles: import("lit").CSSResult[];
6
6
  open: boolean;
7
7
  popBtn: HTMLElement;
8
8
  popContent: HTMLElement;
9
- toggle: 'true' | 'false';
9
+ toggle: "true" | "false";
10
+ noToggle: boolean;
10
11
  inline: boolean;
11
12
  /**
12
13
  * Ombre
13
14
  */
14
- shadow: '' | 'none' | 'sm' | 'md' | 'lg';
15
+ shadow: "" | "none" | "sm" | "md" | "lg";
15
16
  placement: PopPlacement;
16
17
  positioningRuns: boolean;
17
18
  lastContentX: number;
18
19
  lastContentY: number;
19
20
  runPositioning(): void;
20
- _toggle(e: any): void;
21
+ _toggle(e: Event): void;
21
22
  _show(): void;
22
23
  _hide(): void;
23
24
  _handleClosePop(e: Event): void;