@db-ux/wc-core-components 4.0.3 → 4.1.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 (126) hide show
  1. package/CHANGELOG.md +32 -15
  2. package/README.md +9 -4
  3. package/dist/cjs/db-checkbox.cjs.entry.js +30 -4
  4. package/dist/cjs/db-checkbox.entry.cjs.js.map +1 -1
  5. package/dist/cjs/db-custom-select-dropdown.db-custom-select-list.db-custom-select-list-item.db-input.db-tag.entry.cjs.js.map +1 -1
  6. package/dist/cjs/db-custom-select-dropdown_5.cjs.entry.js +32 -5
  7. package/dist/cjs/db-custom-select.cjs.entry.js +76 -47
  8. package/dist/cjs/db-custom-select.entry.cjs.js.map +1 -1
  9. package/dist/cjs/db-notification.cjs.entry.js +2 -2
  10. package/dist/cjs/db-notification.entry.cjs.js.map +1 -1
  11. package/dist/cjs/db-radio.cjs.entry.js +39 -4
  12. package/dist/cjs/db-radio.entry.cjs.js.map +1 -1
  13. package/dist/cjs/db-select.cjs.entry.js +32 -5
  14. package/dist/cjs/db-select.entry.cjs.js.map +1 -1
  15. package/dist/cjs/db-switch.cjs.entry.js +31 -4
  16. package/dist/cjs/db-switch.entry.cjs.js.map +1 -1
  17. package/dist/cjs/db-textarea.cjs.entry.js +32 -5
  18. package/dist/cjs/db-textarea.entry.cjs.js.map +1 -1
  19. package/dist/cjs/db-ux.cjs.js +1 -1
  20. package/dist/cjs/form-components-CPqbzZwG.js +41 -0
  21. package/dist/cjs/form-components-CPqbzZwG.js.map +1 -0
  22. package/dist/cjs/index.cjs.js.map +1 -1
  23. package/dist/cjs/loader.cjs.js +1 -1
  24. package/dist/collection/components/checkbox/checkbox.js +34 -4
  25. package/dist/collection/components/checkbox/checkbox.js.map +1 -1
  26. package/dist/collection/components/custom-select/custom-select.js +108 -50
  27. package/dist/collection/components/custom-select/custom-select.js.map +1 -1
  28. package/dist/collection/components/custom-select/model.js.map +1 -1
  29. package/dist/collection/components/input/input.js +36 -5
  30. package/dist/collection/components/input/input.js.map +1 -1
  31. package/dist/collection/components/notification/notification.js +12 -12
  32. package/dist/collection/components/notification/notification.js.map +1 -1
  33. package/dist/collection/components/radio/model.js.map +1 -1
  34. package/dist/collection/components/radio/radio.js +61 -5
  35. package/dist/collection/components/radio/radio.js.map +1 -1
  36. package/dist/collection/components/select/select.js +36 -5
  37. package/dist/collection/components/select/select.js.map +1 -1
  38. package/dist/collection/components/switch/switch.js +34 -4
  39. package/dist/collection/components/switch/switch.js.map +1 -1
  40. package/dist/collection/components/textarea/textarea.js +36 -5
  41. package/dist/collection/components/textarea/textarea.js.map +1 -1
  42. package/dist/collection/shared/model.js.map +1 -1
  43. package/dist/collection/utils/form-components.js +31 -0
  44. package/dist/collection/utils/form-components.js.map +1 -1
  45. package/dist/custom-elements.json +235 -28
  46. package/dist/db-ux/db-checkbox.entry.esm.js.map +1 -1
  47. package/dist/db-ux/db-custom-select-dropdown.db-custom-select-list.db-custom-select-list-item.db-input.db-tag.entry.esm.js.map +1 -1
  48. package/dist/db-ux/db-custom-select.entry.esm.js.map +1 -1
  49. package/dist/db-ux/db-notification.entry.esm.js.map +1 -1
  50. package/dist/db-ux/db-radio.entry.esm.js.map +1 -1
  51. package/dist/db-ux/db-select.entry.esm.js.map +1 -1
  52. package/dist/db-ux/db-switch.entry.esm.js.map +1 -1
  53. package/dist/db-ux/db-textarea.entry.esm.js.map +1 -1
  54. package/dist/db-ux/db-ux.esm.js +1 -1
  55. package/dist/db-ux/index.esm.js.map +1 -1
  56. package/dist/db-ux/p-59f30e71.entry.js +2 -0
  57. package/dist/db-ux/p-59f30e71.entry.js.map +1 -0
  58. package/dist/db-ux/p-5cbbd49b.entry.js +2 -0
  59. package/dist/db-ux/p-5cbbd49b.entry.js.map +1 -0
  60. package/dist/db-ux/p-68b70ec5.entry.js +2 -0
  61. package/dist/db-ux/p-68b70ec5.entry.js.map +1 -0
  62. package/dist/db-ux/p-751434fa.entry.js +2 -0
  63. package/dist/db-ux/p-751434fa.entry.js.map +1 -0
  64. package/dist/db-ux/p-7f3a0030.entry.js +2 -0
  65. package/dist/db-ux/p-7f3a0030.entry.js.map +1 -0
  66. package/dist/db-ux/p-8f698fc9.entry.js +2 -0
  67. package/dist/db-ux/p-8f698fc9.entry.js.map +1 -0
  68. package/dist/db-ux/p-952cd568.entry.js +2 -0
  69. package/dist/db-ux/p-952cd568.entry.js.map +1 -0
  70. package/dist/db-ux/p-CdVqfu2Z.js +2 -0
  71. package/dist/db-ux/p-CdVqfu2Z.js.map +1 -0
  72. package/dist/db-ux/p-bc2e8a30.entry.js +2 -0
  73. package/dist/db-ux/p-bc2e8a30.entry.js.map +1 -0
  74. package/dist/esm/db-checkbox.entry.js +30 -4
  75. package/dist/esm/db-checkbox.entry.js.map +1 -1
  76. package/dist/esm/db-custom-select-dropdown.db-custom-select-list.db-custom-select-list-item.db-input.db-tag.entry.js.map +1 -1
  77. package/dist/esm/db-custom-select-dropdown_5.entry.js +32 -5
  78. package/dist/esm/db-custom-select.entry.js +76 -47
  79. package/dist/esm/db-custom-select.entry.js.map +1 -1
  80. package/dist/esm/db-notification.entry.js +2 -2
  81. package/dist/esm/db-notification.entry.js.map +1 -1
  82. package/dist/esm/db-radio.entry.js +40 -5
  83. package/dist/esm/db-radio.entry.js.map +1 -1
  84. package/dist/esm/db-select.entry.js +32 -5
  85. package/dist/esm/db-select.entry.js.map +1 -1
  86. package/dist/esm/db-switch.entry.js +31 -4
  87. package/dist/esm/db-switch.entry.js.map +1 -1
  88. package/dist/esm/db-textarea.entry.js +32 -5
  89. package/dist/esm/db-textarea.entry.js.map +1 -1
  90. package/dist/esm/db-ux.js +1 -1
  91. package/dist/esm/form-components-DmI6JmyJ.js +37 -0
  92. package/dist/esm/form-components-DmI6JmyJ.js.map +1 -0
  93. package/dist/esm/index.js.map +1 -1
  94. package/dist/esm/loader.js +1 -1
  95. package/dist/types/components/checkbox/checkbox.d.ts +5 -1
  96. package/dist/types/components/custom-select/custom-select.d.ts +5 -0
  97. package/dist/types/components/custom-select/model.d.ts +5 -0
  98. package/dist/types/components/input/input.d.ts +6 -2
  99. package/dist/types/components/notification/notification.d.ts +1 -1
  100. package/dist/types/components/radio/model.d.ts +3 -3
  101. package/dist/types/components/radio/radio.d.ts +7 -1
  102. package/dist/types/components/select/select.d.ts +6 -2
  103. package/dist/types/components/switch/switch.d.ts +5 -1
  104. package/dist/types/components/textarea/textarea.d.ts +6 -2
  105. package/dist/types/components.d.ts +4 -0
  106. package/dist/types/shared/model.d.ts +6 -2
  107. package/dist/types/utils/form-components.d.ts +9 -0
  108. package/dist/vscode.html-custom-data.json +11 -6
  109. package/dist/web-types.json +43 -18
  110. package/package.json +3 -3
  111. package/dist/db-ux/p-1761357c.entry.js +0 -2
  112. package/dist/db-ux/p-1761357c.entry.js.map +0 -1
  113. package/dist/db-ux/p-233758c5.entry.js +0 -2
  114. package/dist/db-ux/p-233758c5.entry.js.map +0 -1
  115. package/dist/db-ux/p-60f913fa.entry.js +0 -2
  116. package/dist/db-ux/p-60f913fa.entry.js.map +0 -1
  117. package/dist/db-ux/p-93620721.entry.js +0 -2
  118. package/dist/db-ux/p-93620721.entry.js.map +0 -1
  119. package/dist/db-ux/p-c423e7ba.entry.js +0 -2
  120. package/dist/db-ux/p-c423e7ba.entry.js.map +0 -1
  121. package/dist/db-ux/p-c7815d81.entry.js +0 -2
  122. package/dist/db-ux/p-c7815d81.entry.js.map +0 -1
  123. package/dist/db-ux/p-decb47b4.entry.js +0 -2
  124. package/dist/db-ux/p-decb47b4.entry.js.map +0 -1
  125. package/dist/db-ux/p-ecab99ff.entry.js +0 -2
  126. package/dist/db-ux/p-ecab99ff.entry.js.map +0 -1
@@ -1,6 +1,7 @@
1
1
  import { r as registerInstance, h, c as createEvent } from './index-C6WmMqtR.js';
2
2
  import { c as cls, e as getBoolean, u as uuid, g as getBooleanAsString, h as hasVoiceOver, d as delay, s as stringPropVisible, i as isArrayOfStrings, j as getInputValue, f as getNumber, b as isIOSSafari, k as getHideProp } from './index-DhKljLRG.js';
3
3
  import { l as DEFAULT_INVALID_MESSAGE, g as DEFAULT_VALID_MESSAGE_ID_SUFFIX, h as DEFAULT_INVALID_MESSAGE_ID_SUFFIX, j as DEFAULT_DATALIST_ID_SUFFIX, f as DEFAULT_MESSAGE_ID_SUFFIX, k as DEFAULT_VALID_MESSAGE, b as DEFAULT_PLACEHOLDER, a as DEFAULT_LABEL, m as DEFAULT_REMOVE } from './constants-DC9V_oNU.js';
4
+ import { c as addValueResetEventListener } from './form-components-DmI6JmyJ.js';
4
5
 
5
6
  const DBCustomSelectDropdown = class {
6
7
  constructor(hostRef) {
@@ -188,6 +189,7 @@ const DBInput = class {
188
189
  this._descByIds = undefined;
189
190
  this._value = undefined;
190
191
  this._voiceOverFallback = "";
192
+ this.abortController = undefined;
191
193
  }
192
194
  hasValidState() {
193
195
  var _a;
@@ -223,13 +225,13 @@ const DBInput = class {
223
225
  this._descByIds = undefined;
224
226
  }
225
227
  }
226
- handleInput(event) {
228
+ handleInput(event, reset) {
227
229
  if (this.input) {
228
230
  this.input.emit(event);
229
231
  }
230
232
  this.handleValidation();
231
233
  }
232
- handleChange(event) {
234
+ handleChange(event, reset) {
233
235
  if (this.change) {
234
236
  this.change.emit(event);
235
237
  }
@@ -320,6 +322,26 @@ const DBInput = class {
320
322
  watch2() {
321
323
  this.watch2Fn();
322
324
  }
325
+ watch3Fn() {
326
+ if (this._ref) {
327
+ const defaultValue = undefined;
328
+ let controller = this.abortController;
329
+ if (!controller) {
330
+ controller = new AbortController();
331
+ this.abortController = controller;
332
+ }
333
+ addValueResetEventListener(this._ref, {
334
+ value: this.value,
335
+ defaultValue,
336
+ }, (event) => {
337
+ this.handleChange(event, true);
338
+ this.handleInput(event, true);
339
+ }, controller.signal);
340
+ }
341
+ }
342
+ watch3() {
343
+ this.watch3Fn();
344
+ }
323
345
  componentDidLoad() {
324
346
  var _a;
325
347
  this.enableAttributePassing(this._ref, "db-input");
@@ -333,10 +355,15 @@ const DBInput = class {
333
355
  this.watch0Fn();
334
356
  this.watch1Fn();
335
357
  this.watch2Fn();
358
+ this.watch3Fn();
359
+ }
360
+ disconnectedCallback() {
361
+ var _a;
362
+ (_a = this.abortController) === null || _a === void 0 ? void 0 : _a.abort();
336
363
  }
337
364
  render() {
338
365
  var _a, _b, _c, _d, _e, _f, _g, _h;
339
- return (h("div", { key: '59fbbec2fe8d2e6dce0d9fba875b713b90c8828e', class: cls("db-input", this.className), "data-variant": this.variant, "data-hide-label": getHideProp(this.showLabel), "data-show-icon": getBooleanAsString((_a = this.showIconLeading) !== null && _a !== void 0 ? _a : this.showIcon), "data-icon": (_b = this.iconLeading) !== null && _b !== void 0 ? _b : this.icon, "data-icon-trailing": this.iconTrailing, "data-hide-asterisk": getHideProp(this.showRequiredAsterisk), "data-show-icon-trailing": getBooleanAsString(this.showIconTrailing) }, h("label", { key: '4aca80e0a332dc2c7ba19cd3ae7340aeae4deeb6', htmlFor: this._id }, (_c = this.label) !== null && _c !== void 0 ? _c : DEFAULT_LABEL), h("input", { key: 'd05ae2e32650952ecbaae193e0f20134db378152', "aria-invalid": this.validation === "invalid", "data-custom-validity": this.validation, "data-field-sizing": this.fieldSizing, ref: (el) => {
366
+ return (h("div", { key: 'b3e0deb3a86964b8de452dece18f95f027151832', class: cls("db-input", this.className), "data-variant": this.variant, "data-hide-label": getHideProp(this.showLabel), "data-show-icon": getBooleanAsString((_a = this.showIconLeading) !== null && _a !== void 0 ? _a : this.showIcon), "data-icon": (_b = this.iconLeading) !== null && _b !== void 0 ? _b : this.icon, "data-icon-trailing": this.iconTrailing, "data-hide-asterisk": getHideProp(this.showRequiredAsterisk), "data-show-icon-trailing": getBooleanAsString(this.showIconTrailing) }, h("label", { key: 'c6b0cf9b7526b0c77fcd7a0bdd373d391fa18ea6', htmlFor: this._id }, (_c = this.label) !== null && _c !== void 0 ? _c : DEFAULT_LABEL), h("input", { key: 'c12dd974640a41ff64c8b0bf6aabb8ed9a654bfb', "aria-invalid": this.validation === "invalid", "data-custom-validity": this.validation, "data-field-sizing": this.fieldSizing, ref: (el) => {
340
367
  this._ref = el;
341
368
  }, id: this._id, name: this.name, type: this.type || "text", multiple: getBoolean(this.multiple, "multiple"), placeholder: (_d = this.placeholder) !== null && _d !== void 0 ? _d : DEFAULT_PLACEHOLDER, disabled: getBoolean(this.disabled, "disabled"), required: getBoolean(this.required, "required"), step: getNumber(this.step), value: (_e = this.value) !== null && _e !== void 0 ? _e : this._value, maxLength: getNumber(this.maxLength, this.maxlength), minLength: getNumber(this.minLength, this.minlength), max: getInputValue(this.max, this.type), min: getInputValue(this.min, this.type), readOnly: getBoolean(this.readOnly, "readOnly") ||
342
369
  getBoolean(this.readonly, "readonly"), form: this.form, pattern: this.pattern, size: this.size, autoComplete: this.autocomplete, autoFocus: getBoolean(this.autofocus, "autofocus"), enterKeyHint: this.enterkeyhint, inputMode: this.inputmode, onInput: (event) => this.handleInput(event), onChange: (event) => this.handleChange(event), onBlur: (event) => this.handleBlur(event), onFocus: (event) => this.handleFocus(event), list: this.dataList && this._dataListId, "aria-describedby": (_f = this.ariaDescribedBy) !== null && _f !== void 0 ? _f : this._descByIds, role: [
@@ -348,10 +375,10 @@ const DBInput = class {
348
375
  "color",
349
376
  ].includes((_g = this.type) !== null && _g !== void 0 ? _g : "") && isIOSSafari()
350
377
  ? "textbox"
351
- : undefined }), this.dataList ? (h("datalist", { id: this._dataListId }, (_h = this.getDataList()) === null || _h === void 0 ? void 0 : _h.map((option) => (h("option", { key: this._dataListId + "-option-" + option.value, value: option.value }, option.label))))) : null, h("slot", { key: 'f0f507b8d96500e3825ec6d0dafbdc2564caa34b' }), stringPropVisible(this.message, this.showMessage) ? (h("db-infotext", { size: this.messageSize || "small", icon: this.messageIcon, id: this._messageId }, this.message)) : null, this.hasValidState() ? (h("db-infotext", { semantic: "successful", id: this._validMessageId, size: this.validMessageSize || "small" }, this.validMessage || DEFAULT_VALID_MESSAGE)) : null, h("db-infotext", { key: 'dd47a5d8978035e50eb637cc9b5adf250b657684', semantic: "critical", id: this._invalidMessageId, size: this.invalidMessageSize || "small" }, this._invalidMessage), h("span", { key: 'fa3b768f599b592341a3d60d30b8af7ae3ed0d7d', "data-visually-hidden": "true", role: "status" }, this._voiceOverFallback)));
378
+ : undefined }), this.dataList ? (h("datalist", { id: this._dataListId }, (_h = this.getDataList()) === null || _h === void 0 ? void 0 : _h.map((option) => (h("option", { key: this._dataListId + "-option-" + option.value, value: option.value }, option.label))))) : null, h("slot", { key: '231c238218940050bb92948c798d9cc4bcd4b1f8' }), stringPropVisible(this.message, this.showMessage) ? (h("db-infotext", { size: this.messageSize || "small", icon: this.messageIcon, id: this._messageId }, this.message)) : null, this.hasValidState() ? (h("db-infotext", { semantic: "successful", id: this._validMessageId, size: this.validMessageSize || "small" }, this.validMessage || DEFAULT_VALID_MESSAGE)) : null, h("db-infotext", { key: '101dc9398ba3394dc0d2f3b9dbd9f9414a96f59a', semantic: "critical", id: this._invalidMessageId, size: this.invalidMessageSize || "small" }, this._invalidMessage), h("span", { key: '4b2b099a5ee1f0e3d57f591fa8af8ea8633d4d21', "data-visually-hidden": "true", role: "status" }, this._voiceOverFallback)));
352
379
  }
353
380
  static get watchers() { return {
354
- "_ref": ["watch0"],
381
+ "_ref": ["watch0", "watch3"],
355
382
  "invalidMessage": ["watch0"],
356
383
  "_id": ["watch1"],
357
384
  "value": ["watch2"]
@@ -4,6 +4,7 @@ import { h as hasVoiceOver, d as delay, s as stringPropVisible, l as getSearchIn
4
4
  import { D as DocumentClickListener } from './document-click-listener-D1ZXrKSx.js';
5
5
  import { D as DocumentScrollListener } from './document-scroll-listener-DF6f0ByI.js';
6
6
  import { a as handleFixedDropdown } from './floating-components-G-TursYV.js';
7
+ import { b as addResetEventListener } from './form-components-DmI6JmyJ.js';
7
8
 
8
9
  const DBCustomSelect = class {
9
10
  constructor(hostRef) {
@@ -26,6 +27,7 @@ const DBCustomSelect = class {
26
27
  this._infoTextId = undefined;
27
28
  this._validity = "no-validation";
28
29
  this._userInteraction = false;
30
+ this.abortController = undefined;
29
31
  this._descByIds = undefined;
30
32
  this._selectedLabels = "";
31
33
  this._selectedLabelsId = undefined;
@@ -66,7 +68,7 @@ const DBCustomSelect = class {
66
68
  }
67
69
  /* For a11y reasons we need to map the correct message with the select */
68
70
  if (!((_a = this.selectRef) === null || _a === void 0 ? void 0 : _a.validity.valid) || this.validation === "invalid") {
69
- this._descByIds = this._invalidMessageId;
71
+ this.setDescById(this._invalidMessageId);
70
72
  this._invalidMessage =
71
73
  this.invalidMessage ||
72
74
  ((_b = this.selectRef) === null || _b === void 0 ? void 0 : _b.validationMessage) ||
@@ -82,7 +84,7 @@ const DBCustomSelect = class {
82
84
  else if (this.hasValidState() &&
83
85
  ((_d = this.selectRef) === null || _d === void 0 ? void 0 : _d.validity.valid) &&
84
86
  this.required) {
85
- this._descByIds = this._validMessageId;
87
+ this.setDescById(this._validMessageId);
86
88
  if (hasVoiceOver()) {
87
89
  this._voiceOverFallback = (_e = this.validMessage) !== null && _e !== void 0 ? _e : DEFAULT_VALID_MESSAGE;
88
90
  delay(() => (this._voiceOverFallback = ""), 1000);
@@ -90,11 +92,11 @@ const DBCustomSelect = class {
90
92
  this._validity = (_f = this.validation) !== null && _f !== void 0 ? _f : "valid";
91
93
  }
92
94
  else if (stringPropVisible(this.message, this.showMessage)) {
93
- this._descByIds = this._messageId;
95
+ this.setDescById(this._messageId);
94
96
  this._validity = (_g = this.validation) !== null && _g !== void 0 ? _g : "no-validation";
95
97
  }
96
98
  else {
97
- this._descByIds = this._placeholderId;
99
+ this.setDescById(this._placeholderId);
98
100
  this._validity = (_h = this.validation) !== null && _h !== void 0 ? _h : "no-validation";
99
101
  }
100
102
  }
@@ -576,12 +578,34 @@ const DBCustomSelect = class {
576
578
  this.watch7Fn();
577
579
  }
578
580
  watch8Fn() {
579
- this._validity = this.validation;
581
+ if (this.selectRef) {
582
+ let controller = this.abortController;
583
+ if (!controller) {
584
+ controller = new AbortController();
585
+ this.abortController = controller;
586
+ }
587
+ const initialValues = this.values;
588
+ addResetEventListener(this.selectRef, () => {
589
+ const resetValue = initialValues
590
+ ? initialValues
591
+ : this.selectRef.value
592
+ ? [this.selectRef.value]
593
+ : [];
594
+ this.handleOptionSelected(resetValue);
595
+ this.handleValidation();
596
+ }, controller.signal);
597
+ }
580
598
  }
581
599
  watch8() {
582
600
  this.watch8Fn();
583
601
  }
584
602
  watch9Fn() {
603
+ this._validity = this.validation;
604
+ }
605
+ watch9() {
606
+ this.watch9Fn();
607
+ }
608
+ watch10Fn() {
585
609
  var _a, _b;
586
610
  if (((_a = this._values) === null || _a === void 0 ? void 0 : _a.length) === 0) {
587
611
  this.selectAllChecked = false;
@@ -595,29 +619,29 @@ const DBCustomSelect = class {
595
619
  this.selectAllIndeterminate = true;
596
620
  }
597
621
  }
598
- watch9() {
599
- this.watch9Fn();
622
+ watch10() {
623
+ this.watch10Fn();
600
624
  }
601
- watch10Fn() {
625
+ watch11Fn() {
602
626
  var _a, _b;
603
627
  this._options = this.options;
604
628
  this.amountOptions =
605
629
  (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.filter((option) => !option.isGroupTitle).length) !== null && _b !== void 0 ? _b : 0;
606
630
  }
607
- watch10() {
608
- this.watch10Fn();
631
+ watch11() {
632
+ this.watch11Fn();
609
633
  }
610
- watch11Fn() {
634
+ watch12Fn() {
611
635
  this._searchValue = this.searchValue;
612
636
  if (this.searchValue) {
613
637
  const sValue = this.searchValue; // <- workaround for Angular
614
638
  this.handleSearch(sValue);
615
639
  }
616
640
  }
617
- watch11() {
618
- this.watch11Fn();
641
+ watch12() {
642
+ this.watch12Fn();
619
643
  }
620
- watch12Fn() {
644
+ watch13Fn() {
621
645
  var _a, _b;
622
646
  if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.length) {
623
647
  this._selectedOptions = (_b = this.options) === null || _b === void 0 ? void 0 : _b.filter((option) => {
@@ -629,10 +653,10 @@ const DBCustomSelect = class {
629
653
  });
630
654
  }
631
655
  }
632
- watch12() {
633
- this.watch12Fn();
656
+ watch13() {
657
+ this.watch13Fn();
634
658
  }
635
- watch13Fn() {
659
+ watch14Fn() {
636
660
  var _a, _b, _c;
637
661
  if (this.selectedLabels) {
638
662
  this._selectedLabels = this.selectedLabels;
@@ -659,35 +683,35 @@ const DBCustomSelect = class {
659
683
  this._selectedLabels = "";
660
684
  }
661
685
  }
662
- watch13() {
663
- this.watch13Fn();
686
+ watch14() {
687
+ this.watch14Fn();
664
688
  }
665
- watch14Fn() {
689
+ watch15Fn() {
666
690
  var _a, _b;
667
691
  if (this.amountChange) {
668
692
  this.amountChange.emit((_b = (_a = this._selectedOptions) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0);
669
693
  }
670
694
  }
671
- watch14() {
672
- this.watch14Fn();
695
+ watch15() {
696
+ this.watch15Fn();
673
697
  }
674
- watch15Fn() {
698
+ watch16Fn() {
675
699
  if (this.selectAllRef) {
676
700
  this.selectAllRef.indeterminate = Boolean(this.selectAllIndeterminate);
677
701
  }
678
702
  }
679
- watch15() {
680
- this.watch15Fn();
703
+ watch16() {
704
+ this.watch16Fn();
681
705
  }
682
- watch16Fn() {
706
+ watch17Fn() {
683
707
  var _a;
684
708
  this._invalidMessage =
685
709
  this.invalidMessage ||
686
710
  ((_a = this.selectRef) === null || _a === void 0 ? void 0 : _a.validationMessage) ||
687
711
  DEFAULT_INVALID_MESSAGE;
688
712
  }
689
- watch16() {
690
- this.watch16Fn();
713
+ watch17() {
714
+ this.watch17Fn();
691
715
  }
692
716
  componentDidLoad() {
693
717
  var _a;
@@ -731,22 +755,27 @@ const DBCustomSelect = class {
731
755
  this.watch14Fn();
732
756
  this.watch15Fn();
733
757
  this.watch16Fn();
758
+ this.watch17Fn();
759
+ }
760
+ disconnectedCallback() {
761
+ var _a;
762
+ (_a = this.abortController) === null || _a === void 0 ? void 0 : _a.abort();
734
763
  }
735
764
  render() {
736
765
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
737
- return (h("div", { key: '11b17fa4f655a38ae5c5612053ed44d533bf730e', class: cls("db-custom-select", this.className), id: this._id, ref: (el) => {
766
+ return (h("div", { key: '18f3a8ad101671d2aba404bd45c80b928bb5e8f4', class: cls("db-custom-select", this.className), id: this._id, ref: (el) => {
738
767
  this._ref = el;
739
768
  }, "aria-invalid": this._validity === "invalid", "data-custom-validity": this._validity, "data-width": this.formFieldWidth, "data-variant": this.variant === "floating" &&
740
769
  this.selectedType === "tag" &&
741
770
  this.multiple
742
771
  ? "above"
743
- : this.variant, "data-required": getBooleanAsString(this.required), "data-hide-asterisk": getHideProp(this.showRequiredAsterisk), "data-placement": this.placement, "data-selected-type": this.multiple ? this.selectedType : "text", "data-hide-label": getHideProp(this.showLabel), "data-icon": this.icon, "data-show-icon": getBooleanAsString(this.showIcon) }, h("label", { key: '7d7ba83bded2a0f96c20e464a2ffb9702c7aade7', id: this._labelId }, (_a = this.label) !== null && _a !== void 0 ? _a : DEFAULT_LABEL, h("select", { key: '2b7c5ccf1e2033613069958a9de22c4d03d5a2c6', role: "none", hidden: true, id: this._selectId, tabIndex: -1, ref: (el) => {
772
+ : this.variant, "data-required": getBooleanAsString(this.required), "data-hide-asterisk": getHideProp(this.showRequiredAsterisk), "data-placement": this.placement, "data-selected-type": this.multiple ? this.selectedType : "text", "data-hide-label": getHideProp(this.showLabel), "data-icon": this.icon, "data-show-icon": getBooleanAsString(this.showIcon) }, h("label", { key: '8799fa0a17b43d88b24ecee1b1061274524d84f1', id: this._labelId }, (_a = this.label) !== null && _a !== void 0 ? _a : DEFAULT_LABEL, h("select", { key: 'f3f4af4a27d30308028524213d0ab8a5a40a8d3a', role: "none", hidden: true, id: this._selectId, tabIndex: -1, ref: (el) => {
744
773
  this.selectRef = el;
745
774
  }, form: this.form, name: this.name, multiple: getBoolean(this.multiple, "multiple"), disabled: getBoolean(this.disabled, "disabled"), required: getBoolean(this.required, "required"), onChange: (event) => this.satisfyReact(event) }, ((_b = this.options) === null || _b === void 0 ? void 0 : _b.length)
746
775
  ? (_c = this.options) === null || _c === void 0 ? void 0 : _c.map((option) => (h("option", { disabled: option.disabled, value: option.value, key: undefined }, this.getOptionLabel(option))))
747
- : null)), h("details", { key: 'e72a8ffae9e67b8ffa4a864fc67777863ab4ae2f', ref: (el) => {
776
+ : null)), h("details", { key: '413be6e72060b2395772985bc287bd67bc1ad268', ref: (el) => {
748
777
  this.detailsRef = el;
749
- }, open: this.open, onToggle: (event) => this.handleDropdownToggle(event), onKeyDown: (event) => this.handleKeyboardPress(event) }, h("slot", { key: '8a8cdada441011327ceada802a840222e1fee64a' }), this.options ? (h(Fragment, null, h("summary", { class: "db-custom-select-form-field", id: this._summaryId, "aria-disabled": getBooleanAsString(this.disabled), "aria-labelledby": this._labelId }, ((_d = this._selectedLabels) === null || _d === void 0 ? void 0 : _d.length) ? (h("span", { "data-visually-hidden": getBooleanAsString(this.selectedType === "tag"), id: this._selectedLabelsId }, this._selectedLabels)) : null, this.selectedType === "tag" ? (h("div", null, (_e = this._selectedOptions) === null || _e === void 0 ? void 0 : _e.map((option, index) => (h("db-tag", { emphasis: "strong", behavior: "removable", removeButton: this.getTagRemoveLabel(option), onRemove: (event) => this.handleTagRemove(option, event), key: undefined }, this.getOptionLabel(option)))))) : null), h("db-custom-select-dropdown", { width: this.dropdownWidth }, this.searchEnabled ? (h("div", null, h("db-input", { type: "search", ref: (el) => {
778
+ }, open: this.open, onToggle: (event) => this.handleDropdownToggle(event), onKeyDown: (event) => this.handleKeyboardPress(event) }, h("slot", { key: 'f157d0435eab97c98c97d31447e32a9e9cd97d98' }), this.options ? (h(Fragment, null, h("summary", { class: "db-custom-select-form-field", id: this._summaryId, "aria-disabled": getBooleanAsString(this.disabled), "aria-labelledby": this._labelId }, ((_d = this._selectedLabels) === null || _d === void 0 ? void 0 : _d.length) ? (h("span", { "data-visually-hidden": getBooleanAsString(this.selectedType === "tag"), id: this._selectedLabelsId }, this.selectedPrefix ? (h("span", { "data-visually-hidden": "true" }, this.selectedPrefix)) : null, this._selectedLabels)) : null, this.selectedType === "tag" ? (h("div", null, (_e = this._selectedOptions) === null || _e === void 0 ? void 0 : _e.map((option, index) => (h("db-tag", { emphasis: "strong", behavior: "removable", removeButton: this.getTagRemoveLabel(option), onRemove: (event) => this.handleTagRemove(option, event), key: undefined }, this.getOptionLabel(option)))))) : null), h("db-custom-select-dropdown", { width: this.dropdownWidth }, this.searchEnabled ? (h("div", null, h("db-input", { type: "search", ref: (el) => {
750
779
  this.searchInputRef = el;
751
780
  }, name: this._id, form: this._id, showLabel: false, value: this._searchValue, label: (_f = this.searchLabel) !== null && _f !== void 0 ? _f : DEFAULT_LABEL, placeholder: (_g = this.searchPlaceholder) !== null && _g !== void 0 ? _g : this.searchLabel, ariaDescribedBy: this._hasNoOptions || this.showLoading
752
781
  ? this._infoTextId
@@ -756,7 +785,7 @@ const DBCustomSelect = class {
756
785
  this.selectAllRef = el;
757
786
  }, form: this._id, checked: this.selectAllChecked, onChange: (event) => this.handleSelectAll(event) }), this.getSelectAllLabel())))) : null, h("db-custom-select-list", { multiple: getBoolean(this.multiple, "multiple"), label: (_k = (_j = this.listLabel) !== null && _j !== void 0 ? _j : this.label) !== null && _k !== void 0 ? _k : DEFAULT_LABEL }, (_l = this._options) === null || _l === void 0 ? void 0 : _l.map((option) => (h("db-custom-select-list-item", { type: this.multiple ? "checkbox" : "radio", showDivider: option.showDivider, icon: option.icon, isGroupTitle: option.isGroupTitle, groupTitle: this.getOptionLabel(option), name: this._id, checked: this.getOptionChecked(option.value), disabled: option.disabled, value: option.value, onChange: () => this.handleSelect(option.value), key: undefined }, !option.isGroupTitle
758
787
  ? this.getOptionLabel(option)
759
- : null)))))), h("div", null, h("db-button", { variant: "ghost", width: "full", icon: "cross", size: "small", name: this._id, form: this._id, onClick: () => this.handleClose(undefined, true) }, (_m = this.mobileCloseButtonText) !== null && _m !== void 0 ? _m : DEFAULT_CLOSE_BUTTON))))) : null), ((_o = this.showClearSelection) !== null && _o !== void 0 ? _o : true) && ((_p = this._values) === null || _p === void 0 ? void 0 : _p.length) ? (h("db-button", { icon: "cross", variant: "ghost", size: "small", noText: true, name: this._id, form: this._id, onClick: (event) => this.handleClearAll(event) }, this.clearSelectionText, h("db-tooltip", { placement: "top" }, this.clearSelectionText))) : null, h("span", { key: '7bd868a984b59aac7554ce7a414fbc5dcf6f9852', class: "db-custom-select-placeholder", "aria-hidden": getBooleanAsString(true), id: this._placeholderId }, (_q = this.placeholder) !== null && _q !== void 0 ? _q : this.label), stringPropVisible(this.message, this.showMessage) ? (h("db-infotext", { size: "small", icon: this.messageIcon, id: this._messageId }, this.message)) : null, this.hasValidState() ? (h("db-infotext", { size: "small", semantic: "successful", id: this._validMessageId }, this.validMessage || DEFAULT_VALID_MESSAGE)) : null, h("db-infotext", { key: '600afcfae8dd16acad934de05031077efb821e88', size: "small", semantic: "critical", id: this._invalidMessageId }, this._invalidMessage), h("span", { key: '296afa4aaa8ea8bd7aeabcf43e50a8068540c6c4', "data-visually-hidden": "true", role: "status" }, this._voiceOverFallback)));
788
+ : null)))))), h("div", null, h("db-button", { variant: "ghost", width: "full", icon: "cross", size: "small", name: this._id, form: this._id, onClick: () => this.handleClose(undefined, true) }, (_m = this.mobileCloseButtonText) !== null && _m !== void 0 ? _m : DEFAULT_CLOSE_BUTTON))))) : null), ((_o = this.showClearSelection) !== null && _o !== void 0 ? _o : true) && ((_p = this._values) === null || _p === void 0 ? void 0 : _p.length) ? (h("db-button", { icon: "cross", variant: "ghost", size: "small", noText: true, name: this._id, form: this._id, onClick: (event) => this.handleClearAll(event) }, this.clearSelectionText, h("db-tooltip", { placement: "top" }, this.clearSelectionText))) : null, h("span", { key: '0f9dc87d3b0289a335acf336964fc78d22a5798a', class: "db-custom-select-placeholder", "aria-hidden": getBooleanAsString(true), id: this._placeholderId }, (_q = this.placeholder) !== null && _q !== void 0 ? _q : this.label), stringPropVisible(this.message, this.showMessage) ? (h("db-infotext", { size: "small", icon: this.messageIcon, id: this._messageId }, this.message)) : null, this.hasValidState() ? (h("db-infotext", { size: "small", semantic: "successful", id: this._validMessageId }, this.validMessage || DEFAULT_VALID_MESSAGE)) : null, h("db-infotext", { key: '6a32b77468c503d5ee57c509aa2ec7ff5b4c1f21', size: "small", semantic: "critical", id: this._invalidMessageId }, this._invalidMessage), h("span", { key: 'b67bda119e8c547d7975632376ea72c81625a471', "data-visually-hidden": "true", role: "status" }, this._voiceOverFallback)));
760
789
  }
761
790
  static get watchers() { return {
762
791
  "detailsRef": ["watch0", "watch2"],
@@ -766,23 +795,23 @@ const DBCustomSelect = class {
766
795
  "showLoading": ["watch3"],
767
796
  "_options": ["watch3"],
768
797
  "showSelectAll": ["watch4"],
769
- "amountOptions": ["watch4", "watch5", "watch9"],
798
+ "amountOptions": ["watch4", "watch5", "watch10"],
770
799
  "multiple": ["watch4"],
771
800
  "showSearch": ["watch5"],
772
801
  "values": ["watch6"],
773
- "_values": ["watch7", "watch9", "watch12"],
774
- "selectRef": ["watch7", "watch16"],
775
- "validation": ["watch8"],
776
- "options": ["watch10", "watch12"],
777
- "searchValue": ["watch11"],
778
- "_selectedOptions": ["watch13", "watch14"],
779
- "selectedType": ["watch13"],
780
- "amountText": ["watch13"],
781
- "selectedLabels": ["watch13"],
782
- "transformSelectedLabels": ["watch13"],
783
- "selectAllIndeterminate": ["watch15"],
784
- "selectAllRef": ["watch15"],
785
- "invalidMessage": ["watch16"]
802
+ "_values": ["watch7", "watch10", "watch13"],
803
+ "selectRef": ["watch7", "watch8", "watch17"],
804
+ "validation": ["watch9"],
805
+ "options": ["watch11", "watch13"],
806
+ "searchValue": ["watch12"],
807
+ "_selectedOptions": ["watch14", "watch15"],
808
+ "selectedType": ["watch14"],
809
+ "amountText": ["watch14"],
810
+ "selectedLabels": ["watch14"],
811
+ "transformSelectedLabels": ["watch14"],
812
+ "selectAllIndeterminate": ["watch16"],
813
+ "selectAllRef": ["watch16"],
814
+ "invalidMessage": ["watch17"]
786
815
  }; }
787
816
  };
788
817