@ds-autonomie/web-components 1.1.0 → 1.3.0

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 (98) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/chunks/chunk.2WSMYCPC.js +24 -0
  3. package/dist/chunks/{chunk.7EWUWW3E.js → chunk.3Y4CKW7H.js} +1 -1
  4. package/dist/chunks/{chunk.V6V7AGDB.js → chunk.4XH7INOL.js} +1 -1
  5. package/dist/chunks/{chunk.DFTZEFHF.js → chunk.5DKPV25M.js} +1 -1
  6. package/dist/chunks/{chunk.3BL7JA77.js → chunk.5KOTVDN5.js} +2 -7
  7. package/dist/chunks/chunk.5NO4YOTV.js +126 -0
  8. package/dist/chunks/{chunk.GJCVGGCP.js → chunk.76JEX27F.js} +1 -1
  9. package/dist/chunks/{chunk.IQ7SDYSC.js → chunk.7BYKP4SA.js} +14 -0
  10. package/dist/chunks/{chunk.LSKBY2HF.js → chunk.BGNHUCCD.js} +1 -1
  11. package/dist/chunks/{chunk.HEOTAAPU.js → chunk.BHLKMLHB.js} +1 -1
  12. package/dist/chunks/{chunk.NOEQVLAW.js → chunk.BNJQHJKO.js} +1 -1
  13. package/dist/chunks/chunk.CCTWXABH.js +13 -0
  14. package/dist/chunks/{chunk.6BJBVSW4.js → chunk.E7NM6WTF.js} +1 -1
  15. package/dist/chunks/{chunk.DC6CT5PU.js → chunk.EM4JONLW.js} +0 -7
  16. package/dist/chunks/{chunk.W74UQSZJ.js → chunk.FN42VBEO.js} +1 -1
  17. package/dist/chunks/{chunk.VIULAG23.js → chunk.FSXPFNBX.js} +1 -1
  18. package/dist/chunks/{chunk.T7JSALXE.js → chunk.HCQNPYQZ.js} +1 -1
  19. package/dist/chunks/chunk.HRBNFVC5.js +16 -0
  20. package/dist/chunks/{chunk.ZVGZDTBF.js → chunk.IFXLU6P3.js} +8 -16
  21. package/dist/chunks/{chunk.AYXPVAYS.js → chunk.IH3JU5S6.js} +1 -1
  22. package/dist/chunks/{chunk.R37CT3PN.js → chunk.JJLAOWR2.js} +88 -13
  23. package/dist/chunks/{chunk.U5KRBVRP.js → chunk.JKHFW3KV.js} +2 -2
  24. package/dist/chunks/{chunk.DZWH4V6H.js → chunk.KAQ2HMPU.js} +1 -1
  25. package/dist/chunks/{chunk.2CCKS3CP.js → chunk.N5ZXUW7H.js} +1 -1
  26. package/dist/chunks/{chunk.CBMFAOZI.js → chunk.P7QMP76I.js} +4 -3
  27. package/dist/chunks/{chunk.VM355VAS.js → chunk.QDZXNGR6.js} +1 -5
  28. package/dist/chunks/chunk.QSNJ4FV6.js +54 -0
  29. package/dist/chunks/{chunk.L6LQN6AI.js → chunk.RVUFDCSS.js} +1 -1
  30. package/dist/chunks/{chunk.QSPKKO3T.js → chunk.SCNCYZ35.js} +3 -3
  31. package/dist/chunks/{chunk.NKPNQBLW.js → chunk.T4H7RAXS.js} +4 -4
  32. package/dist/chunks/{chunk.ST2QYN4S.js → chunk.WC7TOR3H.js} +1 -1
  33. package/dist/chunks/{chunk.7HGZSZJK.js → chunk.WFJLQFI3.js} +18 -0
  34. package/dist/chunks/{chunk.NBQ3AEK6.js → chunk.XV2S7PIY.js} +1 -1
  35. package/dist/chunks/{chunk.ILUHEJYG.js → chunk.XYHFMIYJ.js} +1 -1
  36. package/dist/chunks/{chunk.RSJYKNXT.js → chunk.Y3VP37FX.js} +1 -1
  37. package/dist/chunks/{chunk.4MC32HP7.js → chunk.YEVEBKAC.js} +1 -1
  38. package/dist/chunks/{chunk.F4XMSVNF.js → chunk.YHOA7MQN.js} +1 -1
  39. package/dist/chunks/chunk.YRBTSDUN.js +134 -0
  40. package/dist/components/accordion/accordion.js +2 -2
  41. package/dist/components/alert/alert.js +2 -2
  42. package/dist/components/badge/badge.d.ts +0 -2
  43. package/dist/components/badge/badge.js +2 -2
  44. package/dist/components/badge/badge.styles.js +1 -1
  45. package/dist/components/breadcrumb/breadcrumb.js +2 -2
  46. package/dist/components/breadcrumb-item/breadcrumb-item.js +2 -2
  47. package/dist/components/button/button.js +3 -3
  48. package/dist/components/combobox/combobox.d.ts +22 -1
  49. package/dist/components/combobox/combobox.js +7 -4
  50. package/dist/components/combobox/combobox.styles.js +1 -1
  51. package/dist/components/dialog/dialog.js +2 -2
  52. package/dist/components/drawer/drawer.js +2 -2
  53. package/dist/components/dropdown/dropdown.js +2 -2
  54. package/dist/components/format-bytes/format-bytes.js +2 -2
  55. package/dist/components/format-date/format-date.js +2 -2
  56. package/dist/components/format-number/format-number.js +2 -2
  57. package/dist/components/input/input.js +2 -2
  58. package/dist/components/input-mask/input-mask.js +2 -2
  59. package/dist/components/input-phone/input-phone.js +7 -7
  60. package/dist/components/option/option.js +2 -2
  61. package/dist/components/progress-bar/progress-bar.js +2 -2
  62. package/dist/components/radio-button/radio-button.js +2 -2
  63. package/dist/components/radio-button/radio-button.styles.js +1 -1
  64. package/dist/components/relative-time/relative-time.js +2 -2
  65. package/dist/components/select/select.js +3 -3
  66. package/dist/components/spinner/spinner.js +2 -2
  67. package/dist/components/step/step.d.ts +39 -0
  68. package/dist/components/step/step.js +24 -0
  69. package/dist/components/step/step.styles.d.ts +2 -0
  70. package/dist/components/step/step.styles.js +8 -0
  71. package/dist/components/step/step.utils.d.ts +3 -0
  72. package/dist/components/step/step.utils.js +7 -0
  73. package/dist/components/stepper/stepper.d.ts +23 -0
  74. package/dist/components/stepper/stepper.js +10 -0
  75. package/dist/components/stepper/stepper.styles.d.ts +2 -0
  76. package/dist/components/stepper/stepper.styles.js +8 -0
  77. package/dist/components/tab/tab.js +2 -2
  78. package/dist/components/tab-group/tab-group.js +2 -2
  79. package/dist/components/tag/tag.js +2 -2
  80. package/dist/components/tooltip/tooltip.js +2 -2
  81. package/dist/components/tree/tree.js +4 -4
  82. package/dist/components/tree-item/tree-item.js +3 -3
  83. package/dist/custom-elements.json +342 -24
  84. package/dist/design-system.d.ts +2 -0
  85. package/dist/design-system.js +56 -44
  86. package/dist/themes/dsa-wc-theme.css +43 -0
  87. package/dist/themes/dsa-wc-theme.min.css +1 -1
  88. package/dist/themes/dsa-wc-theme.styles.js +43 -0
  89. package/dist/translations/en-gb.js +1 -1
  90. package/dist/translations/en.js +1 -1
  91. package/dist/translations/fr.js +1 -1
  92. package/dist/utilities/debounce.d.ts +1 -0
  93. package/dist/utilities/debounce.js +7 -0
  94. package/dist/utilities/localize.d.ts +7 -0
  95. package/dist/utilities/localize.js +1 -1
  96. package/dist/vscode.html-custom-data.json +45 -6
  97. package/dist/web-types.json +167 -15
  98. package/package.json +5 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # @ds-autonomie/web-components
2
2
 
3
+ ## 1.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 24922c0: `badge`: suppression de l'attribut `dot` sur le composant badge
8
+ - 1830489: `combobox`: ajout de l'attribut `onSearch` permettant la recherche asynchrone
9
+
10
+ ### Patch Changes
11
+
12
+ - 24922c0: `tag`: changement de la valeur par défaut du variant sur le composant tag
13
+ - f6b74f4: `breadcrumb`, `breadcrumb-item`: mise en conformité d'accessibilité
14
+ - c2bdab5: `radio-button`: l'icône check a été retiré
15
+ - 07b353b: `combobox`: Résolution des bugs concernant l'utilisation de l'attribut 'items' sur le composant combobox
16
+
17
+ ## 1.2.0
18
+
19
+ ### Minor Changes
20
+
21
+ - b63aa59: `stepper`, `step`: implémentation des composants stepper et step
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies [b63aa59]
26
+ - @ds-autonomie/assets@1.1.1
27
+
3
28
  ## 1.1.0
4
29
 
5
30
  ### Minor Changes
@@ -0,0 +1,24 @@
1
+ import {
2
+ component_styles_default
3
+ } from "./chunk.TUVJKY7S.js";
4
+
5
+ // src/components/stepper/stepper.styles.ts
6
+ import { css } from "lit";
7
+ var stepper_styles_default = css`
8
+ ${component_styles_default}
9
+
10
+ .stepper {
11
+ display: grid;
12
+ grid-auto-flow: column;
13
+ grid-auto-columns: 1fr;
14
+ list-style-type: none;
15
+ }
16
+
17
+ .slot_steps {
18
+ display: none;
19
+ }
20
+ `;
21
+
22
+ export {
23
+ stepper_styles_default
24
+ };
@@ -19,7 +19,7 @@ import {
19
19
  } from "./chunk.ZQJVCRB2.js";
20
20
  import {
21
21
  LocalizeController
22
- } from "./chunk.IQ7SDYSC.js";
22
+ } from "./chunk.7BYKP4SA.js";
23
23
  import {
24
24
  watch
25
25
  } from "./chunk.6IH66JBY.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  LocalizeController
3
- } from "./chunk.IQ7SDYSC.js";
3
+ } from "./chunk.7BYKP4SA.js";
4
4
  import {
5
5
  ShoelaceElement
6
6
  } from "./chunk.YCXTCVAZ.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk.FIGO7UV2.js";
4
4
  import {
5
5
  LocalizeController
6
- } from "./chunk.IQ7SDYSC.js";
6
+ } from "./chunk.7BYKP4SA.js";
7
7
  import {
8
8
  watch
9
9
  } from "./chunk.6IH66JBY.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  badge_styles_default
3
- } from "./chunk.ZVGZDTBF.js";
3
+ } from "./chunk.IFXLU6P3.js";
4
4
  import {
5
5
  ShoelaceElement
6
6
  } from "./chunk.YCXTCVAZ.js";
@@ -16,7 +16,6 @@ var DSABadge = class extends ShoelaceElement {
16
16
  constructor() {
17
17
  super(...arguments);
18
18
  this.variant = "primary";
19
- this.dot = false;
20
19
  this.pulse = false;
21
20
  }
22
21
  render() {
@@ -30,12 +29,11 @@ var DSABadge = class extends ShoelaceElement {
30
29
  "badge--neutral": this.variant === "neutral",
31
30
  "badge--warning": this.variant === "warning",
32
31
  "badge--danger": this.variant === "danger",
33
- "badge--dot": this.dot,
34
32
  "badge--pulse": this.pulse
35
33
  })}
36
34
  role="status"
37
35
  >
38
- <slot class="${classMap({ "badge__slot-dot": this.dot })}"></slot>
36
+ <slot></slot>
39
37
  </div>
40
38
  `;
41
39
  }
@@ -44,9 +42,6 @@ DSABadge.styles = badge_styles_default;
44
42
  __decorateClass([
45
43
  property({ reflect: true })
46
44
  ], DSABadge.prototype, "variant", 2);
47
- __decorateClass([
48
- property({ type: Boolean, reflect: true })
49
- ], DSABadge.prototype, "dot", 2);
50
45
  __decorateClass([
51
46
  property({ type: Boolean, reflect: true })
52
47
  ], DSABadge.prototype, "pulse", 2);
@@ -0,0 +1,126 @@
1
+ import {
2
+ step_styles_default
3
+ } from "./chunk.YRBTSDUN.js";
4
+ import {
5
+ getStepIcon
6
+ } from "./chunk.CCTWXABH.js";
7
+ import {
8
+ HasSlotController
9
+ } from "./chunk.YIY5RM53.js";
10
+ import {
11
+ LocalizeController
12
+ } from "./chunk.7BYKP4SA.js";
13
+ import {
14
+ ShoelaceElement
15
+ } from "./chunk.YCXTCVAZ.js";
16
+ import {
17
+ __decorateClass
18
+ } from "./chunk.6M63UXML.js";
19
+
20
+ // src/components/step/step.ts
21
+ import { html } from "lit";
22
+ import { customElement, property } from "lit/decorators.js";
23
+ import { classMap } from "lit/directives/class-map.js";
24
+ var DSAStep = class extends ShoelaceElement {
25
+ constructor() {
26
+ super(...arguments);
27
+ this.hasSlotController = new HasSlotController(
28
+ this,
29
+ "title",
30
+ "content"
31
+ );
32
+ this.localize = new LocalizeController(this);
33
+ this.status = "default";
34
+ this.title = "";
35
+ this.content = "";
36
+ }
37
+ getStepLabel() {
38
+ switch (this.status) {
39
+ case "default":
40
+ return this.localize.term("step");
41
+ case "complete":
42
+ return this.localize.term("stepCompleted");
43
+ case "in-progress":
44
+ return this.localize.term("stepInProgress");
45
+ case "active":
46
+ return this.localize.term("stepActive");
47
+ case "error":
48
+ return this.localize.term("stepError");
49
+ }
50
+ return this.localize.term("step");
51
+ }
52
+ render() {
53
+ const hasTitleSlot = this.hasSlotController.test("title");
54
+ const hasContentSlot = this.hasSlotController.test("content");
55
+ const hasTitle = this.title ? true : !!hasTitleSlot;
56
+ const hasContent = this.content ? true : !!hasContentSlot;
57
+ const stepIconName = this.status !== "in-progress" && this.status !== "active" ? getStepIcon(this.status) : void 0;
58
+ const stepLabel = this.getStepLabel();
59
+ return html`
60
+ <div
61
+ role="listitem"
62
+ part="step"
63
+ class=${classMap({
64
+ "step-container": true,
65
+ "step-container--has-title": hasTitle,
66
+ "step-container--has-content": hasContent
67
+ })}
68
+ >
69
+ <div
70
+ class=${classMap({
71
+ step: true,
72
+ "step--default": this.status === "default",
73
+ "step--complete": this.status === "complete",
74
+ "step--in-progress": this.status === "in-progress" || this.status === "active",
75
+ "step--error": this.status === "error"
76
+ })}
77
+ >
78
+ ${this.status === "in-progress" || this.status === "active" ? html`<span class="step-icon--in-progress"
79
+ ><dsa-visually-hidden>${stepLabel}</dsa-visually-hidden></span
80
+ >` : html`<dsa-icon
81
+ class="step-icon"
82
+ name="${stepIconName}"
83
+ label=${stepLabel}
84
+ ></dsa-icon>`}
85
+ </div>
86
+
87
+ ${this.index !== void 0 ? html`
88
+ <p class="step-index">
89
+ ${this.localize.term("step")} ${this.index + 1}
90
+ </p>
91
+ ` : html``}
92
+
93
+ <div class="step-title-container">
94
+ <slot
95
+ name="title"
96
+ class="step-title"
97
+ aria-hidden=${hasTitle ? "false" : "true"}
98
+ >${this.title}</slot
99
+ >
100
+ <slot name="tooltip" class="step-tooltip"></slot>
101
+ </div>
102
+ <slot name="content" class="step-content">${this.content}</slot>
103
+ </div>
104
+ `;
105
+ }
106
+ };
107
+ DSAStep.styles = step_styles_default;
108
+ __decorateClass([
109
+ property()
110
+ ], DSAStep.prototype, "status", 2);
111
+ __decorateClass([
112
+ property()
113
+ ], DSAStep.prototype, "title", 2);
114
+ __decorateClass([
115
+ property()
116
+ ], DSAStep.prototype, "content", 2);
117
+ __decorateClass([
118
+ property()
119
+ ], DSAStep.prototype, "index", 2);
120
+ DSAStep = __decorateClass([
121
+ customElement("dsa-step")
122
+ ], DSAStep);
123
+
124
+ export {
125
+ DSAStep
126
+ };
@@ -29,7 +29,7 @@ import {
29
29
  } from "./chunk.V7RJROLH.js";
30
30
  import {
31
31
  LocalizeController
32
- } from "./chunk.IQ7SDYSC.js";
32
+ } from "./chunk.7BYKP4SA.js";
33
33
  import {
34
34
  watch
35
35
  } from "./chunk.6IH66JBY.js";
@@ -36,6 +36,13 @@ var translation = {
36
36
  slideNum: (slide) => `Diapositive ${slide}`,
37
37
  toggleColorFormat: "Changer le format de couleur",
38
38
  noMatchFound: "Aucune correspondance trouv\xE9e",
39
+ optionsLoading: "Chargement des options",
40
+ optionsError: "Une erreur est survenue",
41
+ step: "\xC9tape",
42
+ stepActive: "\xC9tape active",
43
+ stepCompleted: "\xC9tape valid\xE9e",
44
+ stepInProgress: "\xC9tape en cours",
45
+ stepError: "\xC9tape en erreur",
39
46
  // countries
40
47
  fr_FR: "France",
41
48
  fr_GP: "Guadeloupe",
@@ -86,6 +93,13 @@ var translation2 = {
86
93
  slideNum: (slide) => `Slide ${slide}`,
87
94
  toggleColorFormat: "Toggle color format",
88
95
  noMatchFound: "No match found",
96
+ optionsLoading: "Options loading",
97
+ optionsError: "An error has occurred",
98
+ step: "Step",
99
+ stepActive: "Active step",
100
+ stepCompleted: "Step completed",
101
+ stepInProgress: "Step in progress",
102
+ stepError: "Step in error",
89
103
  // countries
90
104
  fr_FR: "France",
91
105
  fr_GP: "Guadeloupe",
@@ -15,7 +15,7 @@ import {
15
15
  } from "./chunk.V7RJROLH.js";
16
16
  import {
17
17
  LocalizeController
18
- } from "./chunk.IQ7SDYSC.js";
18
+ } from "./chunk.7BYKP4SA.js";
19
19
  import {
20
20
  watch
21
21
  } from "./chunk.6IH66JBY.js";
@@ -15,7 +15,7 @@ import {
15
15
  } from "./chunk.V7RJROLH.js";
16
16
  import {
17
17
  LocalizeController
18
- } from "./chunk.IQ7SDYSC.js";
18
+ } from "./chunk.7BYKP4SA.js";
19
19
  import {
20
20
  watch
21
21
  } from "./chunk.6IH66JBY.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk.2DGAEK66.js";
4
4
  import {
5
5
  LocalizeController
6
- } from "./chunk.IQ7SDYSC.js";
6
+ } from "./chunk.7BYKP4SA.js";
7
7
  import {
8
8
  watch
9
9
  } from "./chunk.6IH66JBY.js";
@@ -0,0 +1,13 @@
1
+ // src/components/step/step.utils.ts
2
+ var stepIcons = {
3
+ default: "",
4
+ complete: "check",
5
+ error: "error_outline"
6
+ };
7
+ function getStepIcon(status) {
8
+ return stepIcons[status];
9
+ }
10
+
11
+ export {
12
+ getStepIcon
13
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  LocalizeController
3
- } from "./chunk.IQ7SDYSC.js";
3
+ } from "./chunk.7BYKP4SA.js";
4
4
  import {
5
5
  ShoelaceElement
6
6
  } from "./chunk.YCXTCVAZ.js";
@@ -71,9 +71,6 @@ var radio_button_styles_default = css`
71
71
  border-color: var(--dsa-wc-toggle-button-read-only-checked-border-color);
72
72
  color: var(--dsa-wc-toggle-button-read-only-checked-color);
73
73
  }
74
- .button--toggle.button--checked.button--readonly.button__icon-check {
75
- color: var(--dsa-wc-toggle-button-read-only-checked-icon-color);
76
- }
77
74
 
78
75
  .button--toggle.button--disabled {
79
76
  background-color: var(--dsa-wc-toggle-button-disabled-background-color);
@@ -81,10 +78,6 @@ var radio_button_styles_default = css`
81
78
  color: var(--dsa-wc-toggle-button-disabled-color);
82
79
  }
83
80
 
84
- .button--toggle .button__icon-check {
85
- margin-inline-start: var(--dsa-wc-toggle-button-icon-spacing);
86
- }
87
-
88
81
  .button--toggle .button__icon-readonly {
89
82
  margin-inline-end: var(--dsa-wc-toggle-button-icon-spacing);
90
83
  }
@@ -13,7 +13,7 @@ import {
13
13
  } from "./chunk.ZQJVCRB2.js";
14
14
  import {
15
15
  LocalizeController
16
- } from "./chunk.IQ7SDYSC.js";
16
+ } from "./chunk.7BYKP4SA.js";
17
17
  import {
18
18
  watch
19
19
  } from "./chunk.6IH66JBY.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  LocalizeController
3
- } from "./chunk.IQ7SDYSC.js";
3
+ } from "./chunk.7BYKP4SA.js";
4
4
  import {
5
5
  ShoelaceElement
6
6
  } from "./chunk.YCXTCVAZ.js";
@@ -14,7 +14,7 @@ import {
14
14
  } from "./chunk.V7RJROLH.js";
15
15
  import {
16
16
  LocalizeController
17
- } from "./chunk.IQ7SDYSC.js";
17
+ } from "./chunk.7BYKP4SA.js";
18
18
  import {
19
19
  watch
20
20
  } from "./chunk.6IH66JBY.js";
@@ -0,0 +1,16 @@
1
+ // src/utilities/debounce.ts
2
+ function debounce(fn, time) {
3
+ let timerId = void 0;
4
+ return function debounceFn(search, selectedOptions) {
5
+ if (timerId !== void 0) {
6
+ clearTimeout(timerId);
7
+ }
8
+ return new Promise((resolve) => {
9
+ timerId = setTimeout(() => resolve(fn(search, selectedOptions)), time);
10
+ });
11
+ };
12
+ }
13
+
14
+ export {
15
+ debounce
16
+ };
@@ -12,23 +12,21 @@ var badge_styles_default = css`
12
12
  }
13
13
 
14
14
  .badge {
15
- display: inline-flex;
15
+ display: flex;
16
+ flex-direction: row;
17
+ justify-content: center;
18
+ align-items: center;
19
+ white-space: pre;
16
20
  font: var(--dsa-wc-badge-font);
17
- line-height: 1;
18
21
  border-radius: var(--dsa-wc-badge-border-radius);
19
22
  white-space: nowrap;
20
- padding: 0.5rem;
23
+ padding: var(--spacing-8, 0.5rem);
21
24
  user-select: none;
22
25
  cursor: inherit;
26
+ height: var(--dsa-wc-badge-dot-size);
27
+ min-width: var(--dsa-wc-badge-dot-size);
23
28
  }
24
29
 
25
- .badge__slot-dot {
26
- display: flex;
27
- flex-direction: row;
28
- justify-content: center;
29
- align-items: center;
30
- white-space: pre;
31
- }
32
30
  /* Variant modifiers */
33
31
  .badge--primary {
34
32
  background-color: var(--dsa-wc-badge-background-color-primary);
@@ -55,12 +53,6 @@ var badge_styles_default = css`
55
53
  color: var(--dsa-wc-badge-text-color-danger);
56
54
  }
57
55
 
58
- /* Dot modifier */
59
- .badge--dot {
60
- font: var(--dsa-wc-badge-dot-font);
61
- padding: var(--dsa-wc-badge-dot-padding);
62
- }
63
-
64
56
  /* Pulse modifier */
65
57
  .badge--pulse {
66
58
  animation: pulse 1.5s var(--dsa-wc-no-animations-duration, infinite);
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  LocalizeController
3
- } from "./chunk.IQ7SDYSC.js";
3
+ } from "./chunk.7BYKP4SA.js";
4
4
  import {
5
5
  ShoelaceElement
6
6
  } from "./chunk.YCXTCVAZ.js";
@@ -1,3 +1,6 @@
1
+ import {
2
+ debounce
3
+ } from "./chunk.HRBNFVC5.js";
1
4
  import {
2
5
  scrollIntoView
3
6
  } from "./chunk.EMIT7S33.js";
@@ -6,7 +9,7 @@ import {
6
9
  } from "./chunk.CMJ2SRTL.js";
7
10
  import {
8
11
  combobox_styles_default
9
- } from "./chunk.7HGZSZJK.js";
12
+ } from "./chunk.WFJLQFI3.js";
10
13
  import {
11
14
  FormControlController
12
15
  } from "./chunk.KIFBWPW5.js";
@@ -26,7 +29,7 @@ import {
26
29
  } from "./chunk.V7RJROLH.js";
27
30
  import {
28
31
  LocalizeController
29
- } from "./chunk.IQ7SDYSC.js";
32
+ } from "./chunk.7BYKP4SA.js";
30
33
  import {
31
34
  watch
32
35
  } from "./chunk.6IH66JBY.js";
@@ -55,6 +58,7 @@ var DSACombobox = class extends ShoelaceElement {
55
58
  );
56
59
  this.localize = new LocalizeController(this);
57
60
  this.hasVisualFocus = false;
61
+ this.fetchingState = "success";
58
62
  this.displayLabel = "";
59
63
  this.selectedOptions = [];
60
64
  this.allOptions = [];
@@ -81,6 +85,8 @@ var DSACombobox = class extends ShoelaceElement {
81
85
  this.items = void 0;
82
86
  this.multiple = false;
83
87
  this.maxOptionsVisible = 3;
88
+ this.onSearch = void 0;
89
+ this.debounceTimeout = 300;
84
90
  }
85
91
  /** Gets the validity state object */
86
92
  get validity() {
@@ -90,13 +96,18 @@ var DSACombobox = class extends ShoelaceElement {
90
96
  get validationMessage() {
91
97
  return this.valueInput.validationMessage;
92
98
  }
93
- connectedCallback() {
99
+ async connectedCallback() {
100
+ var _a;
94
101
  super.connectedCallback();
95
102
  this.handleDocumentFocusIn = this.handleDocumentFocusIn.bind(this);
96
103
  this.handleDocumentMouseDown = this.handleDocumentMouseDown.bind(this);
97
104
  this.handleDocumentKeyDown = this.handleDocumentKeyDown.bind(this);
98
105
  this.open = false;
99
- this.allOptions = this.getAllOptions();
106
+ if (this.onSearch !== void 0) {
107
+ this.allOptions = (_a = await this.getRemoteOptions()) != null ? _a : [];
108
+ } else {
109
+ this.allOptions = this.getAllOptions();
110
+ }
100
111
  this.filteredOptions = [...this.allOptions];
101
112
  }
102
113
  /** Input events */
@@ -142,8 +153,8 @@ var DSACombobox = class extends ShoelaceElement {
142
153
  }
143
154
  this.filterOptions(this.displayLabel);
144
155
  }
145
- handleInput() {
146
- var _a;
156
+ async handleInput() {
157
+ var _a, _b;
147
158
  this.displayLabel = this.displayInput.value;
148
159
  this.show();
149
160
  this.emit("dsa-input");
@@ -152,7 +163,31 @@ var DSACombobox = class extends ShoelaceElement {
152
163
  this.clearSelectedOptions();
153
164
  }
154
165
  }
155
- this.filterOptions(this.displayLabel);
166
+ if (this.onSearch !== void 0) {
167
+ const remoteOptions = (_b = await this.getRemoteOptions()) != null ? _b : [];
168
+ this.filterRemoteOptions(remoteOptions);
169
+ } else {
170
+ this.filterOptions(this.displayLabel);
171
+ }
172
+ }
173
+ filterRemoteOptions(remoteOptions) {
174
+ const nonSelectedOptions = remoteOptions.filter(
175
+ (option) => this.selectedOptions.every((selectedOption) => {
176
+ return selectedOption.value !== option.value;
177
+ })
178
+ );
179
+ this.allOptions = [...this.selectedOptions, ...nonSelectedOptions];
180
+ this.filteredOptions = [...this.selectedOptions, ...nonSelectedOptions];
181
+ }
182
+ asyncFetchOptions() {
183
+ if (this.onSearch !== void 0) {
184
+ const debouncedOnSearch = debounce(this.onSearch, this.debounceTimeout);
185
+ return debouncedOnSearch(
186
+ this.displayLabel,
187
+ this.selectedOptions.map((option) => option.value)
188
+ );
189
+ }
190
+ return void 0;
156
191
  }
157
192
  handleClearClick(event) {
158
193
  event.stopPropagation();
@@ -167,9 +202,11 @@ var DSACombobox = class extends ShoelaceElement {
167
202
  }
168
203
  }
169
204
  filterOptions(filter) {
170
- this.filteredOptions = this.allOptions.filter((option) => {
171
- return option.innerText.toLowerCase().includes(filter.toLowerCase());
172
- });
205
+ if (this.onSearch === void 0) {
206
+ this.filteredOptions = this.allOptions.filter((option) => {
207
+ return option.innerText.toLowerCase().includes(filter.toLowerCase());
208
+ });
209
+ }
173
210
  }
174
211
  // Toggles an option's selected state
175
212
  toggleOptionSelection(option, force) {
@@ -227,6 +264,23 @@ var DSACombobox = class extends ShoelaceElement {
227
264
  }
228
265
  return [...this.querySelectorAll(OPTION_TAG)];
229
266
  }
267
+ // Gets an array of all remote <dsa-option> elements
268
+ async getRemoteOptions() {
269
+ var _a;
270
+ let remoteOptions = [];
271
+ try {
272
+ this.fetchingState = "loading";
273
+ remoteOptions = (_a = await this.asyncFetchOptions()) != null ? _a : [];
274
+ this.fetchingState = "success";
275
+ this.emit("dsa-load");
276
+ } catch (e) {
277
+ remoteOptions = [];
278
+ this.fetchingState = "error";
279
+ this.emit("dsa-error");
280
+ throw e;
281
+ }
282
+ return remoteOptions;
283
+ }
230
284
  clearSelectedOptions() {
231
285
  this.allOptions.forEach((el) => {
232
286
  el.selected = false;
@@ -401,7 +455,7 @@ var DSACombobox = class extends ShoelaceElement {
401
455
  }
402
456
  }
403
457
  handleItemsChange() {
404
- this.allOptions = this.items !== void 0 ? this.items : [];
458
+ this.allOptions = this.getAllOptions();
405
459
  this.filterOptions(this.displayLabel);
406
460
  }
407
461
  handleValueChange() {
@@ -684,11 +738,23 @@ var DSACombobox = class extends ShoelaceElement {
684
738
  @mouseup=${this.handleOptionClick}
685
739
  @slotchange=${this.handleDefaultSlotChange}
686
740
  >
687
- ${this.filteredOptions.length > 0 ? this.filteredOptions : html`
741
+ ${this.fetchingState === "loading" ? html`
742
+ <div class="select__loading_text">
743
+ <dsa-spinner></dsa-spinner>
744
+ <p>${this.localize.term("optionsLoading")}</p>
745
+ </div>
746
+ ` : html``}
747
+ ${this.fetchingState === "error" ? html`
748
+ <div class="select__loading_text">
749
+ <p>${this.localize.term("optionsError")}</p>
750
+ </div>
751
+ ` : html``}
752
+ ${this.fetchingState === "success" && this.filteredOptions.length > 0 ? this.filteredOptions : html``}
753
+ ${this.fetchingState === "success" && this.filteredOptions.length === 0 ? html`
688
754
  <div class="select__empty_text">
689
755
  <p>${this.localize.term("noMatchFound")}</p>
690
756
  </div>
691
- `}
757
+ ` : html``}
692
758
  </ul>
693
759
 
694
760
  <slot
@@ -738,6 +804,9 @@ __decorateClass([
738
804
  __decorateClass([
739
805
  state()
740
806
  ], DSACombobox.prototype, "hasVisualFocus", 2);
807
+ __decorateClass([
808
+ state()
809
+ ], DSACombobox.prototype, "fetchingState", 2);
741
810
  __decorateClass([
742
811
  state()
743
812
  ], DSACombobox.prototype, "displayLabel", 2);
@@ -830,6 +899,12 @@ __decorateClass([
830
899
  __decorateClass([
831
900
  property({ attribute: "max-options-visible", type: Number })
832
901
  ], DSACombobox.prototype, "maxOptionsVisible", 2);
902
+ __decorateClass([
903
+ property({ type: Function, attribute: false })
904
+ ], DSACombobox.prototype, "onSearch", 2);
905
+ __decorateClass([
906
+ property({ type: Number, attribute: "debounce-timeout" })
907
+ ], DSACombobox.prototype, "debounceTimeout", 2);
833
908
  __decorateClass([
834
909
  watch("disabled", { waitUntilFirstUpdate: true })
835
910
  ], DSACombobox.prototype, "handleDisabledChange", 1);
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk.ZQJVCRB2.js";
7
7
  import {
8
8
  LocalizeController
9
- } from "./chunk.IQ7SDYSC.js";
9
+ } from "./chunk.7BYKP4SA.js";
10
10
  import {
11
11
  ShoelaceElement
12
12
  } from "./chunk.YCXTCVAZ.js";
@@ -23,7 +23,7 @@ var DSATag = class extends ShoelaceElement {
23
23
  super(...arguments);
24
24
  this.localize = new LocalizeController(this);
25
25
  this.disableRemovableFocus = false;
26
- this.variant = "purple-300";
26
+ this.variant = "purple-100";
27
27
  this.size = "medium";
28
28
  this.removable = false;
29
29
  this.label = "";