@supersoniks/concorde 2.0.2 → 2.0.3

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 (102) hide show
  1. package/README.md +1 -0
  2. package/concorde-core.bundle.js +748 -690
  3. package/concorde-core.es.js +3897 -3116
  4. package/core/_types/types.d.ts +2 -4
  5. package/core/components/functional/date/date.d.ts +4 -2
  6. package/core/components/functional/date/date.js +28 -13
  7. package/core/components/functional/fetch/fetch.d.ts +9 -10
  8. package/core/components/functional/fetch/fetch.js +21 -5
  9. package/core/components/functional/list/list.d.ts +7 -10
  10. package/core/components/functional/list/list.js +19 -4
  11. package/core/components/functional/queue/queue.d.ts +3 -2
  12. package/core/components/functional/queue/queue.js +66 -61
  13. package/core/components/functional/router/router.d.ts +1 -0
  14. package/core/components/functional/router/router.js +12 -1
  15. package/core/components/functional/sdui/sdui.d.ts +2 -7
  16. package/core/components/functional/submit/submit.js +11 -4
  17. package/core/components/ui/_css/scroll.js +13 -11
  18. package/core/components/ui/_css/size.js +1 -1
  19. package/core/components/ui/alert/alert.d.ts +14 -3
  20. package/core/components/ui/alert/alert.js +34 -4
  21. package/core/components/ui/badge/badge.js +10 -3
  22. package/core/components/ui/button/button.d.ts +19 -10
  23. package/core/components/ui/button/button.js +77 -22
  24. package/core/components/ui/captcha/captcha.d.ts +5 -4
  25. package/core/components/ui/captcha/captcha.js +33 -9
  26. package/core/components/ui/divider/divider.d.ts +2 -0
  27. package/core/components/ui/divider/divider.js +17 -2
  28. package/core/components/ui/form/checkbox/checkbox.d.ts +24 -9
  29. package/core/components/ui/form/checkbox/checkbox.js +4 -6
  30. package/core/components/ui/form/css/form-control.js +40 -7
  31. package/core/components/ui/form/fieldset/fieldset.d.ts +1 -0
  32. package/core/components/ui/form/fieldset/fieldset.js +14 -1
  33. package/core/components/ui/form/fieldset/legend-description.js +3 -3
  34. package/core/components/ui/form/fieldset/legend.js +2 -8
  35. package/core/components/ui/form/input/input.d.ts +4 -5
  36. package/core/components/ui/form/input/input.js +17 -13
  37. package/core/components/ui/form/input-autocomplete/input-autocomplete.d.ts +3 -5
  38. package/core/components/ui/form/input-autocomplete/input-autocomplete.js +9 -9
  39. package/core/components/ui/form/select/select.d.ts +4 -1
  40. package/core/components/ui/form/select/select.js +25 -18
  41. package/core/components/ui/form/textarea/textarea.d.ts +4 -5
  42. package/core/components/ui/form/textarea/textarea.js +19 -10
  43. package/core/components/ui/group/group.js +3 -3
  44. package/core/components/ui/icon/icon.js +2 -1
  45. package/core/components/ui/icon/icons.d.ts +0 -4
  46. package/core/components/ui/icon/icons.js +3 -16
  47. package/core/components/ui/link/link.d.ts +5 -2
  48. package/core/components/ui/link/link.js +31 -2
  49. package/core/components/ui/loader/loader.d.ts +4 -1
  50. package/core/components/ui/loader/loader.js +11 -3
  51. package/core/components/ui/loader/styles/inline.js +14 -16
  52. package/core/components/ui/menu/menu-item.js +2 -1
  53. package/core/components/ui/menu/menu.js +6 -22
  54. package/core/components/ui/modal/modal-close.js +2 -1
  55. package/core/components/ui/modal/modal.d.ts +13 -1
  56. package/core/components/ui/modal/modal.js +70 -10
  57. package/core/components/ui/pop/pop.d.ts +9 -3
  58. package/core/components/ui/pop/pop.js +46 -23
  59. package/core/components/ui/table/table-tr.d.ts +10 -2
  60. package/core/components/ui/table/table-tr.js +30 -2
  61. package/core/components/ui/table/table.d.ts +1 -0
  62. package/core/components/ui/table/table.js +7 -1
  63. package/core/components/ui/theme/theme-collection/core-variables.js +8 -19
  64. package/core/components/ui/theme/theme.d.ts +6 -0
  65. package/core/components/ui/theme/theme.js +11 -13
  66. package/core/components/ui/toast/message-subscriber.d.ts +0 -8
  67. package/core/components/ui/toast/message-subscriber.js +0 -46
  68. package/core/components/ui/toast/toast-item.js +31 -40
  69. package/core/components/ui/toast/toast.d.ts +5 -1
  70. package/core/components/ui/toast/toast.js +80 -13
  71. package/core/components/ui/tooltip/tooltip.d.ts +3 -1
  72. package/core/components/ui/tooltip/tooltip.js +22 -0
  73. package/core/decorators/Subscriber.d.ts +3 -3
  74. package/core/decorators/Subscriber.js +64 -21
  75. package/core/directives/DataProvider.d.ts +12 -7
  76. package/core/directives/DataProvider.js +23 -8
  77. package/core/directives/Wording.d.ts +42 -0
  78. package/core/directives/Wording.js +202 -0
  79. package/core/mixins/Fetcher.d.ts +8 -11
  80. package/core/mixins/Fetcher.js +38 -22
  81. package/core/mixins/FormCheckable.d.ts +1 -4
  82. package/core/mixins/FormElement.d.ts +1 -0
  83. package/core/mixins/FormElement.js +3 -6
  84. package/core/mixins/FormInput.d.ts +3 -5
  85. package/core/mixins/FormInput.js +4 -0
  86. package/core/mixins/Subscriber.d.ts +0 -4
  87. package/core/mixins/Subscriber.js +13 -89
  88. package/core/mixins/TemplatesContainer.js +9 -0
  89. package/core/utils/Format.d.ts +1 -0
  90. package/core/utils/Format.js +16 -0
  91. package/core/utils/HTML.d.ts +13 -0
  92. package/core/utils/HTML.js +42 -3
  93. package/core/utils/Objects.d.ts +1 -0
  94. package/core/utils/Objects.js +5 -0
  95. package/core/utils/PublisherProxy.d.ts +16 -10
  96. package/core/utils/PublisherProxy.js +100 -64
  97. package/core/utils/Utils.d.ts +1 -0
  98. package/core/utils/Utils.js +5 -0
  99. package/core/utils/api.d.ts +26 -0
  100. package/core/utils/api.js +135 -3
  101. package/mixins.d.ts +6 -16
  102. package/package.json +7 -2
@@ -5,7 +5,7 @@ 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, property, queryAssignedElements, query } from "lit/decorators.js";
8
+ import { customElement, property, queryAssignedNodes, query } from "lit/decorators.js";
9
9
  import { unsafeHTML } from "lit/directives/unsafe-html.js";
10
10
  const tagName = "sonic-divider";
11
11
  let Divider = class Divider extends LitElement {
@@ -15,6 +15,8 @@ let Divider = class Divider extends LitElement {
15
15
  this.align = "center";
16
16
  this.vertical = false;
17
17
  this.noMargin = false;
18
+ this.dashed = false;
19
+ this.dotted = false;
18
20
  }
19
21
  firstUpdated(changedProperties) {
20
22
  super.firstUpdated(changedProperties);
@@ -148,10 +150,17 @@ Divider.styles = [
148
150
  .has-text {
149
151
  gap: 0.5rem;
150
152
  }
153
+
154
+ :host([dotted]) {
155
+ --sc-divider-border-style: dotted;
156
+ }
157
+ :host([dashed]) {
158
+ --sc-divider-border-style: dashed;
159
+ }
151
160
  `,
152
161
  ];
153
162
  __decorate([
154
- queryAssignedElements({ flatten: true })
163
+ queryAssignedNodes({ flatten: true })
155
164
  ], Divider.prototype, "slotNodes", void 0);
156
165
  __decorate([
157
166
  query("div")
@@ -171,6 +180,12 @@ __decorate([
171
180
  __decorate([
172
181
  property({ type: Boolean, reflect: true })
173
182
  ], Divider.prototype, "noMargin", void 0);
183
+ __decorate([
184
+ property({ type: Boolean, reflect: true })
185
+ ], Divider.prototype, "dashed", void 0);
186
+ __decorate([
187
+ property({ type: Boolean, reflect: true })
188
+ ], Divider.prototype, "dotted", void 0);
174
189
  Divider = __decorate([
175
190
  customElement(tagName)
176
191
  ], Divider);
@@ -24,6 +24,7 @@ declare const Checkbox_base: {
24
24
  getFormPublisher(): any;
25
25
  updateDataValue(): void;
26
26
  handleBlur(e?: Event | undefined): void;
27
+ setValueFromPublisher(value: string | object | string[] | null | undefined): void;
27
28
  focus?: (() => void) | undefined;
28
29
  shadowRoot?: ShadowRoot | undefined;
29
30
  error: boolean;
@@ -60,10 +61,6 @@ declare const Checkbox_base: {
60
61
  getAttribute(name: string): string;
61
62
  hasAttribute(attributeName: string): boolean;
62
63
  getBoundingClientRect(): DOMRect;
63
- onConnected(callback: (component: any) => void): void;
64
- offConnected(callback: (component: any) => void): void;
65
- onDisconnected(callback: (component: any) => void): void;
66
- offDisconnected(callback: (component: any) => void): void;
67
64
  };
68
65
  } & {
69
66
  new (...args: any[]): {
@@ -75,13 +72,35 @@ declare const Checkbox_base: {
75
72
  description: string | undefined;
76
73
  _label?: string | undefined;
77
74
  label: string | undefined;
75
+ status: "error" | "default" | "success" | "warning" | "info";
78
76
  tabindex?: number | undefined;
79
- autocomplete?: "url" | "name" | "on" | "additional-name" | "address-level1" | "address-level2" | "address-level3" | "address-level4" | "address-line1" | "address-line2" | "address-line3" | "bday-day" | "bday-month" | "bday-year" | "cc-csc" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-family-name" | "cc-given-name" | "cc-name" | "cc-number" | "cc-type" | "country" | "country-name" | "current-password" | "family-name" | "given-name" | "honorific-prefix" | "honorific-suffix" | "new-password" | "one-time-code" | "organization" | "postal-code" | "street-address" | "transaction-amount" | "transaction-currency" | "username" | "email" | "tel" | "tel-area-code" | "tel-country-code" | "tel-extension" | "tel-local" | "tel-national" | "language" | "nickname" | "organization-title" | "cc-additional-name" | "bday" | "sex" | "impp" | "photo" | undefined;
77
+ autocomplete?: "url" | "name" | "off" | "on" | "additional-name" | "address-level1" | "address-level2" | "address-level3" | "address-level4" | "address-line1" | "address-line2" | "address-line3" | "bday-day" | "bday-month" | "bday-year" | "cc-csc" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-family-name" | "cc-given-name" | "cc-name" | "cc-number" | "cc-type" | "country" | "country-name" | "current-password" | "family-name" | "given-name" | "honorific-prefix" | "honorific-suffix" | "new-password" | "one-time-code" | "organization" | "postal-code" | "street-address" | "transaction-amount" | "transaction-currency" | "username" | "email" | "tel" | "tel-area-code" | "tel-country-code" | "tel-extension" | "tel-local" | "tel-national" | "language" | "nickname" | "organization-title" | "cc-additional-name" | "bday" | "sex" | "impp" | "photo" | undefined;
80
78
  getFormPublisher(): any;
81
79
  updateDataValue(): void;
82
80
  handleChange(e?: Event | undefined): void;
83
81
  handleBlur(e?: Event | undefined): void;
82
+ /**
83
+ * ### Le composent sonic-checkbox étend les mixins FormCheckable, FormInput, FormElement et Subscriber
84
+ * **FormElement :**
85
+ * * 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é.
86
+ * * Par défault lorsque modifie l'input, la valeur est également mise à jour via le même dataprovider
87
+ * * On peut cependant décider de mettre à jour la donnée à une autre adresse en renseigne l'attribut *formDataProvider*.
88
+ * * 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.
89
+ * * **FormInput **
90
+ * 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.
91
+ * **FormCheckable :**
92
+ * * 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.
93
+ * **Comportements :**
94
+ * * multiple (par défaut):
95
+ * - on peut cocher plusieurs checkbox ayant le même *name*.
96
+ * - 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*.
97
+ * * unique (Ajouter l'attribute unique au composant a l'intégration):
98
+ * - on ne peut cocher qu'une seule checkbox ayant le même *name*.
99
+ * * radio (Ajouter l'attribute radio au composant a l'intégration):
100
+ * Comme unique, mais on ne peut pas décocher la case sauf en en cochant une autre, comme un bouton radio.
101
+ */
84
102
  getValueForFormPublisher(): string | object | string[] | null | undefined;
103
+ setValueFromPublisher(value: string | object | string[] | null | undefined): void;
85
104
  focus?: (() => void) | undefined;
86
105
  shadowRoot?: ShadowRoot | undefined;
87
106
  error: boolean;
@@ -122,10 +141,6 @@ declare const Checkbox_base: {
122
141
  hasAttribute(attributeName: string): boolean;
123
142
  disconnectedCallback(): void;
124
143
  getBoundingClientRect(): DOMRect;
125
- onConnected(callback: (component: any) => void): void;
126
- offConnected(callback: (component: any) => void): void;
127
- onDisconnected(callback: (component: any) => void): void;
128
- offDisconnected(callback: (component: any) => void): void;
129
144
  };
130
145
  } & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/FormElement").FormElementInterface) & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<import("../../../../_types/types").CoreJSType>) & typeof LitElement;
131
146
  /**
@@ -5,7 +5,7 @@ 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, property, queryAssignedElements } from "lit/decorators.js";
8
+ import { customElement, property, queryAssignedNodes } from "lit/decorators.js";
9
9
  import { ifDefined } from "lit/directives/if-defined.js";
10
10
  import Subscriber from "@supersoniks/concorde/core/mixins/Subscriber";
11
11
  import FormElement from "@supersoniks/concorde/core/mixins/FormElement";
@@ -84,9 +84,7 @@ let Checkbox = class Checkbox extends FormCheckable(FormInput(FormElement(Subscr
84
84
  <div class="checkbox-text ${!this.hasDescription && !this.hasLabel ? "hidden" : "checkbox-text"}">
85
85
  ${this.label ? unsafeHTML(this.label /*+ labelStarSuffix*/) : ""}
86
86
  <slot @slotchange=${this.hasSlotOrProps}></slot>
87
- <slot @slotchange=${this.hasSlotOrProps} name="description" class="${this.hasDescription ? "description" : "hidden"} ">
88
- ${this.description ? html `${unsafeHTML(this.description)}` : ""}
89
- </slot>
87
+ <slot @slotchange=${this.hasSlotOrProps} name="description" class="${this.hasDescription ? "description" : "hidden"} ">${this.description ? html `${unsafeHTML(this.description)}` : ""}</slot>
90
88
  </div>
91
89
  </label>
92
90
  </label>
@@ -241,10 +239,10 @@ __decorate([
241
239
  property({ type: Boolean })
242
240
  ], Checkbox.prototype, "hasLabel", void 0);
243
241
  __decorate([
244
- queryAssignedElements({ flatten: true })
242
+ queryAssignedNodes({ flatten: true })
245
243
  ], Checkbox.prototype, "slotLabelNodes", void 0);
246
244
  __decorate([
247
- queryAssignedElements({ slot: "description", flatten: true })
245
+ queryAssignedNodes({ slot: "description", flatten: true })
248
246
  ], Checkbox.prototype, "slotDescriptionNodes", void 0);
249
247
  Checkbox = __decorate([
250
248
  customElement(tagName)
@@ -67,13 +67,11 @@ export const formControl = css `
67
67
 
68
68
  line-height: 1.1;
69
69
  color: var(--sc-input-c);
70
- border-radius: var(--sc-item-rounded-tl) var(--sc-item-rounded-tr)
71
- var(--sc-item-rounded-br) var(--sc-item-rounded-bl);
70
+ border-radius: var(--sc-item-rounded-tl) var(--sc-item-rounded-tr) var(--sc-item-rounded-br) var(--sc-item-rounded-bl);
72
71
 
73
72
  font-family: var(--sc-input-ff);
74
73
  background-color: var(--sc-input-background);
75
- border: var(--sc-input-b-width) solid
76
- var(--sc-input-b-color, var(--sc-base-300, #aaa));
74
+ border: var(--sc-input-b-width) solid var(--sc-input-b-color, var(--sc-base-300, #aaa));
77
75
  width: 100%;
78
76
  font-size: var(--sc-input-fs);
79
77
 
@@ -82,6 +80,10 @@ export const formControl = css `
82
80
  padding-left: var(--sc-input-px);
83
81
  padding-right: var(--sc-input-px);
84
82
 
83
+ transition:
84
+ border-color 0.15s ease-in-out,
85
+ color 0.15s ease-in-out,
86
+ box-shadow 0.15s ease-in-out;
85
87
  min-height: var(--sc-input-height);
86
88
  }
87
89
 
@@ -100,6 +102,7 @@ export const formControl = css `
100
102
  justify-content: center;
101
103
  line-height: 1.1;
102
104
  flex-shrink: 0;
105
+ border: var(--sc-input-b-width) solid transparent;
103
106
  padding-left: clamp(0.25em, 3%, calc(0.33 * var(--sc-input-px)));
104
107
  padding-right: clamp(0.25em, 3%, calc(0.33 * var(--sc-input-px)));
105
108
  }
@@ -120,6 +123,11 @@ export const formControl = css `
120
123
  border: none;*/
121
124
  }
122
125
 
126
+ :host(:not([inlineContent])[disabled]) .has-suffix slot[name="suffix"],
127
+ :host(:not([inlineContent])[disabled]) .has-prefix slot[name="prefix"] {
128
+ opacity: 0.43;
129
+ }
130
+
123
131
  :host(:not([inlineContent])) .has-prefix .form-element {
124
132
  border-top-left-radius: 0;
125
133
  border-bottom-left-radius: 0;
@@ -202,7 +210,7 @@ export const formControl = css `
202
210
  /*Disbaled*/
203
211
  :host([disabled]) .form-element {
204
212
  pointer-events: none;
205
- opacity: 0.5;
213
+ opacity: 0.43;
206
214
  /* border-color: transparent;*/
207
215
  }
208
216
  :host([disabled]) .select-chevron {
@@ -291,8 +299,7 @@ export const formControl = css `
291
299
  }
292
300
  input[type="color"]::-webkit-color-swatch {
293
301
  border: none;
294
- border-radius: var(--sc-item-rounded-tl) var(--sc-item-rounded-tr)
295
- var(--sc-item-rounded-br) var(--sc-item-rounded-bl);
302
+ border-radius: var(--sc-item-rounded-tl) var(--sc-item-rounded-tr) var(--sc-item-rounded-br) var(--sc-item-rounded-bl);
296
303
  }
297
304
 
298
305
  /*Input Image*/
@@ -343,4 +350,30 @@ export const formControl = css `
343
350
  :host([noAppearance]) input[type="number"] {
344
351
  -moz-appearance: textfield !important;
345
352
  }
353
+
354
+ /*type color "default" | "success" | "error" | "warning" | "info" */
355
+ :host([status="success"]) {
356
+ --sc-input-b-color: var(--sc-success);
357
+ --sc-input-c: var(--sc-success);
358
+ --sc-input-addon-bg: var(--sc-success);
359
+ --sc-input-addon-color: var(--sc-success-content);
360
+ }
361
+ :host([status="error"]) {
362
+ --sc-input-b-color: var(--sc-danger);
363
+ --sc-input-c: var(--sc-danger);
364
+ --sc-input-addon-bg: var(--sc-danger);
365
+ --sc-input-addon-color: var(--sc-danger-content);
366
+ }
367
+ :host([status="warning"]) {
368
+ --sc-input-b-color: var(--sc-warning);
369
+ --sc-input-c: var(--sc-warning);
370
+ --sc-input-addon-bg: var(--sc-warning);
371
+ --sc-input-addon-color: var(--sc-warning-content);
372
+ }
373
+ :host([status="info"]) {
374
+ --sc-input-b-color: var(--sc-info);
375
+ --sc-input-c: var(--sc-info);
376
+ --sc-input-addon-bg: var(--sc-info);
377
+ --sc-input-addon-color: var(--sc-info-content);
378
+ }
346
379
  `;
@@ -16,6 +16,7 @@ export declare class Fieldset extends Fieldset_base {
16
16
  iconName?: string;
17
17
  iconLibrary?: string;
18
18
  iconPrefix?: string;
19
+ tight?: boolean;
19
20
  variant: "default" | "ghost" | "shadow";
20
21
  render(): import("lit-html").TemplateResult<1>;
21
22
  }
@@ -42,12 +42,14 @@ Fieldset.styles = [
42
42
  --sc-fieldset-mb: 1rem;
43
43
  --sc-fieldset-border-color: var(--sc-border-color);
44
44
  --sc-fieldset-border-width: var(--sc-form-border-width);
45
+ --sc-fieldset-px: 1.25rem;
46
+ --sc-fieldset-py: 1.8rem;
45
47
 
46
48
  margin-top: var(--sc-fieldset-mt);
47
49
  margin-bottom: var(--sc-fieldset-mb);
48
50
  display: block;
49
51
  border: var(--sc-fieldset-border-width) solid var(--sc-fieldset-border-color) !important;
50
- padding: 1.8rem 1.25rem;
52
+ padding: var(--sc-fieldset-py) var(--sc-fieldset-px);
51
53
  border-radius: var(--sc-rounded-lg);
52
54
  }
53
55
 
@@ -55,6 +57,7 @@ Fieldset.styles = [
55
57
  all: unset;
56
58
  display: contents;
57
59
  }
60
+
58
61
  :host([variant="shadow"]),
59
62
  :host([variant="ghost"]) {
60
63
  --sc-fieldset-border-color: transparent;
@@ -64,6 +67,13 @@ Fieldset.styles = [
64
67
  box-shadow: var(--sc-shadow-lg);
65
68
  }
66
69
 
70
+ :host([tight]) {
71
+ --sc-fieldset-px: 0;
72
+ border-left: none !important;
73
+ border-right: none !important;
74
+ border-radius: 0;
75
+ }
76
+
67
77
  sonic-legend,
68
78
  ::slotted(sonic-legend) {
69
79
  margin-bottom: 1.5rem;
@@ -96,6 +106,9 @@ __decorate([
96
106
  __decorate([
97
107
  property({ type: String })
98
108
  ], Fieldset.prototype, "iconPrefix", void 0);
109
+ __decorate([
110
+ property({ type: Boolean, reflect: true })
111
+ ], Fieldset.prototype, "tight", void 0);
99
112
  __decorate([
100
113
  property({ type: String, reflect: true })
101
114
  ], Fieldset.prototype, "variant", void 0);
@@ -14,13 +14,13 @@ let LegendDescription = class LegendDescription extends LitElement {
14
14
  LegendDescription.styles = [
15
15
  css `
16
16
  :host {
17
- color: var(--sc-neutral-500);
18
- font-size: 1.25rem;
17
+ font-size: 1.15rem;
19
18
  line-height: 1.2;
20
19
  display: block;
20
+ color: var(--sc-base-500);
21
21
  font-weight: var(--sc-font-weight-base);
22
22
  font-style: var(--sc-font-style-base);
23
- margin-top: 0.25em;
23
+ margin-top: 0.2em;
24
24
  }
25
25
  `,
26
26
  ];
@@ -37,19 +37,13 @@ let Legend = class Legend extends LitElement {
37
37
  return html `<legend part="legend">
38
38
  ${this.iconName
39
39
  ? html `<div class="icon">
40
- <sonic-icon
41
- name=${this.iconName}
42
- prefix=${ifDefined(this.iconPrefix)}
43
- library=${ifDefined(this.iconLibrary)}
44
- ></sonic-icon>
40
+ <sonic-icon name=${this.iconName} prefix=${ifDefined(this.iconPrefix)} library=${ifDefined(this.iconLibrary)}></sonic-icon>
45
41
  </div>`
46
42
  : ""}
47
43
 
48
44
  <div class="legend-content">
49
45
  ${unsafeHTML(this.label ? this.label : "")}
50
- ${this.description
51
- ? html `<sonic-legend-description>${unsafeHTML(this.description)}</sonic-legend-description>`
52
- : ""}
46
+ ${this.description ? html `<sonic-legend-description>${unsafeHTML(this.description)}</sonic-legend-description>` : ""}
53
47
  <slot></slot>
54
48
  </div>
55
49
  <slot name="suffix"></slot>
@@ -9,13 +9,15 @@ declare const Input_base: {
9
9
  description: string | undefined;
10
10
  _label?: string | undefined;
11
11
  label: string | undefined;
12
+ status: "error" | "default" | "success" | "warning" | "info";
12
13
  tabindex?: number | undefined;
13
- autocomplete?: "url" | "name" | "on" | "additional-name" | "address-level1" | "address-level2" | "address-level3" | "address-level4" | "address-line1" | "address-line2" | "address-line3" | "bday-day" | "bday-month" | "bday-year" | "cc-csc" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-family-name" | "cc-given-name" | "cc-name" | "cc-number" | "cc-type" | "country" | "country-name" | "current-password" | "family-name" | "given-name" | "honorific-prefix" | "honorific-suffix" | "new-password" | "one-time-code" | "organization" | "postal-code" | "street-address" | "transaction-amount" | "transaction-currency" | "username" | "email" | "tel" | "tel-area-code" | "tel-country-code" | "tel-extension" | "tel-local" | "tel-national" | "language" | "nickname" | "organization-title" | "cc-additional-name" | "bday" | "sex" | "impp" | "photo" | undefined;
14
+ autocomplete?: "url" | "name" | "off" | "on" | "additional-name" | "address-level1" | "address-level2" | "address-level3" | "address-level4" | "address-line1" | "address-line2" | "address-line3" | "bday-day" | "bday-month" | "bday-year" | "cc-csc" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-family-name" | "cc-given-name" | "cc-name" | "cc-number" | "cc-type" | "country" | "country-name" | "current-password" | "family-name" | "given-name" | "honorific-prefix" | "honorific-suffix" | "new-password" | "one-time-code" | "organization" | "postal-code" | "street-address" | "transaction-amount" | "transaction-currency" | "username" | "email" | "tel" | "tel-area-code" | "tel-country-code" | "tel-extension" | "tel-local" | "tel-national" | "language" | "nickname" | "organization-title" | "cc-additional-name" | "bday" | "sex" | "impp" | "photo" | undefined;
14
15
  getFormPublisher(): any;
15
16
  updateDataValue(): void;
16
17
  handleChange(e?: Event | undefined): void;
17
18
  handleBlur(e?: Event | undefined): void;
18
19
  getValueForFormPublisher(): string | object | string[] | null | undefined;
20
+ setValueFromPublisher(value: string | object | string[] | null | undefined): void;
19
21
  focus?: (() => void) | undefined;
20
22
  shadowRoot?: ShadowRoot | undefined;
21
23
  error: boolean;
@@ -56,10 +58,6 @@ declare const Input_base: {
56
58
  hasAttribute(attributeName: string): boolean;
57
59
  disconnectedCallback(): void;
58
60
  getBoundingClientRect(): DOMRect;
59
- onConnected(callback: (component: any) => void): void;
60
- offConnected(callback: (component: any) => void): void;
61
- onDisconnected(callback: (component: any) => void): void;
62
- offDisconnected(callback: (component: any) => void): void;
63
61
  };
64
62
  } & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/FormElement").FormElementInterface) & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<import("../../../../_types/types").CoreJSType>) & typeof LitElement;
65
63
  export declare class Input extends Input_base {
@@ -95,6 +93,7 @@ export declare class Input extends Input_base {
95
93
  sameValueAsName?: string;
96
94
  connectedCallback(): void;
97
95
  disconnectedCallback(): void;
96
+ escapeRegExp(string: string): string;
98
97
  willUpdate(changedProperties: PropertyValues): void;
99
98
  setSelectionRange(start: number, end: number): void;
100
99
  hasSlotOrProps(): void;
@@ -4,8 +4,8 @@ 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 } from "lit";
8
- import { customElement, property, queryAssignedElements, state } from "lit/decorators.js";
7
+ import { html, LitElement, css, nothing } from "lit";
8
+ import { customElement, property, queryAssignedNodes, state } from "lit/decorators.js";
9
9
  import { query } from "lit/decorators/query.js";
10
10
  import { ifDefined } from "lit/directives/if-defined.js";
11
11
  import { formControl, label, description, passwordToggle } from "@supersoniks/concorde/core/components/ui/form/css/form-control";
@@ -44,7 +44,7 @@ let Input = class Input extends FormInput(FormElement(Subscriber(LitElement))) {
44
44
  this.hasSlotOrProps();
45
45
  if (this.hasAttribute("sameValueAs")) {
46
46
  this.sameValueAsName = this.getAttribute("sameValueAs");
47
- this.sameValueAsHandle = (v) => (this.pattern = v);
47
+ this.sameValueAsHandle = (v) => (this.pattern = this.escapeRegExp(v));
48
48
  const formPublisher = this.getFormPublisher();
49
49
  if (!formPublisher)
50
50
  return;
@@ -65,6 +65,9 @@ let Input = class Input extends FormInput(FormElement(Subscriber(LitElement))) {
65
65
  formPublisher[this.sameValueAsName].offAssign(this.sameValueAsHandle);
66
66
  }
67
67
  }
68
+ escapeRegExp(string) {
69
+ return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string
70
+ }
68
71
  willUpdate(changedProperties) {
69
72
  this.hasSlotOrProps();
70
73
  super.willUpdate(changedProperties);
@@ -107,7 +110,7 @@ let Input = class Input extends FormInput(FormElement(Subscriber(LitElement))) {
107
110
  };
108
111
  //let labelStarSuffix = this.label && this.required && this.label.indexOf("*") == -1 ? " *" : "";
109
112
  return html `
110
- <label for="form-element" class="${this.hasLabel ? "form-label" : "hidden"}"
113
+ <label for="${this.id || "form-element"}" class="${this.hasLabel ? "form-label" : "hidden"}"
111
114
  >${this.label ? unsafeHTML(this.label /*+ labelStarSuffix*/) : ""}<slot
112
115
  name="label"
113
116
  @slotchange=${this.hasSlotOrProps}
@@ -115,10 +118,11 @@ let Input = class Input extends FormInput(FormElement(Subscriber(LitElement))) {
115
118
  ></label>
116
119
 
117
120
  <div @click=${this.inlineContentFocus} class="form-control ${classMap(slotClasses)}">
118
- <div class="${this.inlineContent ? "form-element form-element-wrapper" : "contents"}">
121
+ <div part="content" class="${this.inlineContent ? "form-element form-element-wrapper" : "contents"}">
119
122
  <slot name="prefix" @slotchange=${this.hasSlotOrProps}></slot>
120
123
  <input
121
- id="form-element"
124
+ part="input"
125
+ id=${ifDefined(this.id || "form-element")}
122
126
  part="input"
123
127
  class="form-element input"
124
128
  @input=${this.handleChange}
@@ -158,13 +162,13 @@ let Input = class Input extends FormInput(FormElement(Subscriber(LitElement))) {
158
162
  <slot name="suffix" @slotchange=${this.hasSlotOrProps}></slot>
159
163
  </div>
160
164
  </div>
165
+
166
+ <!-- le slot ne doit pas avoir d'espace-->
161
167
  <slot
162
168
  name="description"
163
169
  @slotchange=${this.hasSlotOrProps}
164
170
  class="${this.hasDescription ? "form-description" : "hidden"}"
165
- >
166
- ${this.description ? html `${unsafeHTML(this.description)}` : ""}
167
- </slot>
171
+ >${this.description ? html `${unsafeHTML(this.description)}` : nothing}</slot>
168
172
  <slot name="list"></slot>
169
173
  </div>
170
174
  `;
@@ -229,16 +233,16 @@ __decorate([
229
233
  property({ type: Boolean })
230
234
  ], Input.prototype, "showPasswordToggle", void 0);
231
235
  __decorate([
232
- queryAssignedElements({ slot: "label", flatten: true })
236
+ queryAssignedNodes({ slot: "label", flatten: true })
233
237
  ], Input.prototype, "slotLabelNodes", void 0);
234
238
  __decorate([
235
- queryAssignedElements({ slot: "description", flatten: true })
239
+ queryAssignedNodes({ slot: "description", flatten: true })
236
240
  ], Input.prototype, "slotDescriptionNodes", void 0);
237
241
  __decorate([
238
- queryAssignedElements({ slot: "suffix", flatten: true })
242
+ queryAssignedNodes({ slot: "suffix", flatten: true })
239
243
  ], Input.prototype, "slotSuffixNodes", void 0);
240
244
  __decorate([
241
- queryAssignedElements({ slot: "prefix", flatten: true })
245
+ queryAssignedNodes({ slot: "prefix", flatten: true })
242
246
  ], Input.prototype, "slotPrefixNodes", void 0);
243
247
  __decorate([
244
248
  query("input")
@@ -16,13 +16,15 @@ declare const InputAutocomplete_base: (new (...args: any[]) => import("../../../
16
16
  description: string | undefined;
17
17
  _label?: string | undefined;
18
18
  label: string | undefined;
19
+ status: "error" | "default" | "success" | "warning" | "info";
19
20
  tabindex?: number | undefined;
20
- autocomplete?: "url" | "name" | "on" | "additional-name" | "address-level1" | "address-level2" | "address-level3" | "address-level4" | "address-line1" | "address-line2" | "address-line3" | "bday-day" | "bday-month" | "bday-year" | "cc-csc" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-family-name" | "cc-given-name" | "cc-name" | "cc-number" | "cc-type" | "country" | "country-name" | "current-password" | "family-name" | "given-name" | "honorific-prefix" | "honorific-suffix" | "new-password" | "one-time-code" | "organization" | "postal-code" | "street-address" | "transaction-amount" | "transaction-currency" | "username" | "email" | "tel" | "tel-area-code" | "tel-country-code" | "tel-extension" | "tel-local" | "tel-national" | "language" | "nickname" | "organization-title" | "cc-additional-name" | "bday" | "sex" | "impp" | "photo" | undefined;
21
+ autocomplete?: "url" | "name" | "off" | "on" | "additional-name" | "address-level1" | "address-level2" | "address-level3" | "address-level4" | "address-line1" | "address-line2" | "address-line3" | "bday-day" | "bday-month" | "bday-year" | "cc-csc" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-family-name" | "cc-given-name" | "cc-name" | "cc-number" | "cc-type" | "country" | "country-name" | "current-password" | "family-name" | "given-name" | "honorific-prefix" | "honorific-suffix" | "new-password" | "one-time-code" | "organization" | "postal-code" | "street-address" | "transaction-amount" | "transaction-currency" | "username" | "email" | "tel" | "tel-area-code" | "tel-country-code" | "tel-extension" | "tel-local" | "tel-national" | "language" | "nickname" | "organization-title" | "cc-additional-name" | "bday" | "sex" | "impp" | "photo" | undefined;
21
22
  getFormPublisher(): any;
22
23
  updateDataValue(): void;
23
24
  handleChange(e?: Event | undefined): void;
24
25
  handleBlur(e?: Event | undefined): void;
25
26
  getValueForFormPublisher(): string | object | string[] | null | undefined;
27
+ setValueFromPublisher(value: string | object | string[] | null | undefined): void;
26
28
  focus?: (() => void) | undefined;
27
29
  shadowRoot?: ShadowRoot | undefined;
28
30
  error: boolean;
@@ -63,10 +65,6 @@ declare const InputAutocomplete_base: (new (...args: any[]) => import("../../../
63
65
  hasAttribute(attributeName: string): boolean;
64
66
  disconnectedCallback(): void;
65
67
  getBoundingClientRect(): DOMRect;
66
- onConnected(callback: (component: any) => void): void;
67
- offConnected(callback: (component: any) => void): void;
68
- onDisconnected(callback: (component: any) => void): void;
69
- offDisconnected(callback: (component: any) => void): void;
70
68
  };
71
69
  } & (new (...args: any[]) => import("../../../../mixins/FormElement").FormElementInterface) & (new (...args: any[]) => import("../../../../mixins/Subscriber").SubscriberInterface<import("../../../../_types/types").CoreJSType>) & typeof LitElement;
72
70
  /**
@@ -5,7 +5,7 @@ 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, nothing } from "lit";
8
- import { customElement, property, queryAssignedElements, state } from "lit/decorators.js";
8
+ import { customElement, property, queryAssignedNodes, state } from "lit/decorators.js";
9
9
  import { FormInput, FormElement, Subscriber, TemplatesContainer } from "@supersoniks/concorde/mixins";
10
10
  import "@supersoniks/concorde/core/components/ui/form/input/input";
11
11
  import "@supersoniks/concorde/core/components/ui/pop/pop";
@@ -56,7 +56,7 @@ let InputAutocomplete = class InputAutocomplete extends TemplatesContainer(FormI
56
56
  this.lastValidSearch = "";
57
57
  return;
58
58
  }
59
- let found = this.queryQueueListItem(this.queueDataProvider, this.findSelection, this.setSearchFromSelection);
59
+ const found = this.queryQueueListItem(this.queueDataProvider, this.findSelection, this.setSearchFromSelection);
60
60
  // Si la liste de this.queueDataProvider est bien initialisée, mais qu'aucun item ne correspond à la recherche
61
61
  // On affiche quand même la valeur dans le champ de recherche, car il provient directement du formDataProvider
62
62
  if (found === false) {
@@ -68,20 +68,19 @@ let InputAutocomplete = class InputAutocomplete extends TemplatesContainer(FormI
68
68
  this.queryQueueListItem(this.initQueueDataProvider, this.findSelection, this.setSearchFromSelection);
69
69
  };
70
70
  this.selectListItem = (listItem) => {
71
- let value = this.propertyName === "_self" ? listItem : listItem[this.propertyName || this.name];
71
+ const value = this.propertyName === "_self" ? listItem : listItem[this.propertyName || this.name];
72
72
  this.formValuePublisher?.set(value);
73
73
  };
74
74
  this.findSearchedItem = (listItem) => {
75
- let value = this.propertyName === "_self" ? listItem : listItem[this.propertyName || this.searchParameter || this.name];
75
+ const value = this.propertyName === "_self" ? listItem : listItem[this.propertyName || this.searchParameter || this.name];
76
76
  return value == this.searchPublisher?.get();
77
77
  };
78
78
  this.findSelection = (listItem) => {
79
- let value = this.propertyName === "_self" ? listItem : listItem[this.propertyName || this.name];
79
+ const value = this.propertyName === "_self" ? listItem : listItem[this.propertyName || this.name];
80
80
  return value == this.value;
81
81
  };
82
82
  this.setSearchFromSelection = (listItem) => {
83
- this.lastValidSearch =
84
- this.propertyName === "_self" ? listItem : listItem[this.propertyName || this.searchParameter || this.name];
83
+ this.lastValidSearch = this.propertyName === "_self" ? listItem : listItem[this.propertyName || this.searchParameter || this.name];
85
84
  this.searchPublisher?.set(this.lastValidSearch);
86
85
  };
87
86
  this.updateActiveSelection = () => {
@@ -229,6 +228,7 @@ let InputAutocomplete = class InputAutocomplete extends TemplatesContainer(FormI
229
228
  </sonic-queue>
230
229
  <sonic-queue
231
230
  noLazyload
231
+ noLoader
232
232
  dataProvider="${this.initQueueDataProvider}"
233
233
  filteredFields=${this.filteredFields}
234
234
  dataProviderExpression="${this.dataProviderExpression}"
@@ -251,7 +251,7 @@ InputAutocomplete.styles = [
251
251
 
252
252
  sonic-menu {
253
253
  display: block;
254
- max-height: clamp(20rem, 55vh, 35rem);
254
+ max-height: clamp(12rem, 20vh, 20rem);
255
255
  min-width: 14rem;
256
256
  width: 100%;
257
257
  }
@@ -285,7 +285,7 @@ __decorate([
285
285
  property({ type: String })
286
286
  ], InputAutocomplete.prototype, "propertyName", void 0);
287
287
  __decorate([
288
- queryAssignedElements({ slot: "prefix", flatten: true })
288
+ queryAssignedNodes({ slot: "prefix", flatten: true })
289
289
  ], InputAutocomplete.prototype, "slotInputPrefixNodes", void 0);
290
290
  __decorate([
291
291
  state()
@@ -1,9 +1,10 @@
1
1
  import { LitElement, PropertyValues } from "lit";
2
2
  import "@supersoniks/concorde/core/components/ui/icon/icon";
3
3
  import { Size } from "@supersoniks/concorde/core/components/ui/_css/size";
4
+ import { DirectiveResult } from "lit/async-directive";
4
5
  export type SelectOption = {
5
6
  value?: string;
6
- wording?: string;
7
+ wording?: string | DirectiveResult;
7
8
  selected?: boolean;
8
9
  hasAttribute?: (value: string) => boolean;
9
10
  } & Record<string, string>;
@@ -22,6 +23,7 @@ export declare class Select extends Select_base {
22
23
  multiple: boolean;
23
24
  size?: Size;
24
25
  selectSize?: number;
26
+ status: "default" | "success" | "error" | "warning" | "info";
25
27
  private _options;
26
28
  set options(options: Array<SelectOption>);
27
29
  get options(): Array<SelectOption>;
@@ -32,6 +34,7 @@ export declare class Select extends Select_base {
32
34
  get value(): string;
33
35
  updateFormPublisherValue(): void;
34
36
  connectedCallback(): void;
37
+ updateOptions: () => void;
35
38
  forceAutoFill: boolean;
36
39
  _description?: string;
37
40
  get description(): string | undefined;