@beeq/core 1.8.5-beta.2 → 1.9.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 (50) hide show
  1. package/dist/beeq/beeq.esm.js +1 -1
  2. package/dist/beeq/bq-select.entry.esm.js.map +1 -1
  3. package/dist/beeq/index.esm.js +1 -1
  4. package/dist/beeq/index.esm.js.map +1 -1
  5. package/dist/beeq/p-BO2RoztC.js +6 -0
  6. package/dist/beeq/p-BO2RoztC.js.map +1 -0
  7. package/dist/beeq/p-e5a52055.entry.js +6 -0
  8. package/dist/beeq/p-e5a52055.entry.js.map +1 -0
  9. package/dist/beeq.html-custom-data.json +67 -67
  10. package/dist/cjs/beeq.cjs.js +1 -1
  11. package/dist/cjs/bq-select.cjs.entry.js +60 -20
  12. package/dist/cjs/bq-select.cjs.entry.js.map +1 -1
  13. package/dist/cjs/bq-select.entry.cjs.js.map +1 -1
  14. package/dist/cjs/index.cjs.js +2 -0
  15. package/dist/cjs/index.cjs.js.map +1 -1
  16. package/dist/cjs/loader.cjs.js +1 -1
  17. package/dist/cjs/stringToArray-DWnmNBjZ.js +31 -0
  18. package/dist/cjs/stringToArray-DWnmNBjZ.js.map +1 -0
  19. package/dist/collection/components/input/scss/bq-input.css +1 -1
  20. package/dist/collection/components/select/bq-select.js +109 -21
  21. package/dist/collection/components/select/bq-select.js.map +1 -1
  22. package/dist/collection/shared/utils/index.js +1 -0
  23. package/dist/collection/shared/utils/index.js.map +1 -1
  24. package/dist/collection/shared/utils/stringToArray.js +24 -0
  25. package/dist/collection/shared/utils/stringToArray.js.map +1 -0
  26. package/dist/components/bq-select.js +1 -1
  27. package/dist/components/bq-select.js.map +1 -1
  28. package/dist/components/index.js +1 -1
  29. package/dist/components/index.js.map +1 -1
  30. package/dist/custom-elements.json +746 -707
  31. package/dist/esm/beeq.js +1 -1
  32. package/dist/esm/bq-select.entry.js +60 -20
  33. package/dist/esm/bq-select.entry.js.map +1 -1
  34. package/dist/esm/index.js +1 -0
  35. package/dist/esm/index.js.map +1 -1
  36. package/dist/esm/loader.js +1 -1
  37. package/dist/esm/stringToArray-g9MEtfgW.js +29 -0
  38. package/dist/esm/stringToArray-g9MEtfgW.js.map +1 -0
  39. package/dist/hydrate/index.js +80 -21
  40. package/dist/hydrate/index.mjs +80 -21
  41. package/dist/types/components/select/bq-select.d.ts +14 -0
  42. package/dist/types/components.d.ts +12 -0
  43. package/dist/types/shared/utils/index.d.ts +1 -0
  44. package/dist/types/shared/utils/stringToArray.d.ts +8 -0
  45. package/package.json +1 -1
  46. package/dist/beeq/p-f5b3e9be.entry.js +0 -6
  47. package/dist/beeq/p-f5b3e9be.entry.js.map +0 -1
  48. /package/dist/types/{Users/dramos/PROJECTs/ENDAVA/BEEQ-Design-System → home/runner/work/BEEQ/BEEQ}/.stencil/packages/beeq/jest.config.d.ts +0 -0
  49. /package/dist/types/{Users/dramos/PROJECTs/ENDAVA/BEEQ-Design-System → home/runner/work/BEEQ/BEEQ}/.stencil/packages/beeq/stencil.config.d.ts +0 -0
  50. /package/dist/types/{Users/dramos/PROJECTs/ENDAVA/BEEQ-Design-System → home/runner/work/BEEQ/BEEQ}/.stencil/tailwind.config.d.ts +0 -0
@@ -3,7 +3,7 @@
3
3
  * © https://beeq.design - Apache 2 License.
4
4
  */
5
5
  import { h } from "@stencil/core";
6
- import { debounce, hasSlotContent, isDefined, isHTMLElement, isNil, isString } from "../../shared/utils";
6
+ import { debounce, hasSlotContent, isDefined, isHTMLElement, isNil, stringToArray, } from "../../shared/utils";
7
7
  /**
8
8
  * The select input component lets users choose from a predefined list, commonly used in forms for easy data selection.
9
9
  *
@@ -118,6 +118,7 @@ export class BqSelect {
118
118
  prefixElem;
119
119
  suffixElem;
120
120
  debounceQuery;
121
+ debounceInput;
121
122
  fallbackInputId = 'select';
122
123
  // Reference to host HTML element
123
124
  // ===================================
@@ -197,12 +198,23 @@ export class BqSelect {
197
198
  // Prop lifecycle events
198
199
  // =======================
199
200
  handleValueChange() {
200
- if (this.multiple && isString(this.value)) {
201
- // NOTE: we ensure that value is an array, changing the value will trigger Watch to execute thus the return
202
- this.value = Array.from(JSON.parse(String(this.value)));
201
+ // Early return for undefined/null values
202
+ if (isNil(this.value)) {
203
+ this.value = this.multiple ? [] : '';
204
+ this.internals.setFormValue(undefined);
205
+ this.syncItemsFromValue();
206
+ return;
207
+ }
208
+ // Handle multiple selection mode
209
+ if (this.multiple) {
210
+ this.value = stringToArray(this.value);
203
211
  this.internals.setFormValue(this.value.join(','));
212
+ this.syncItemsFromValue();
204
213
  return;
205
214
  }
215
+ // Handle single selection mode
216
+ this.value = String(this.value);
217
+ this.internals.setFormValue(this.value);
206
218
  this.syncItemsFromValue();
207
219
  }
208
220
  // Events section
@@ -216,6 +228,8 @@ export class BqSelect {
216
228
  bqFocus;
217
229
  /** Callback handler emitted when the selected value has changed */
218
230
  bqSelect;
231
+ /** Callback handler emitted when the Select input changes its value while typing */
232
+ bqInput;
219
233
  // Component lifecycle events
220
234
  // Ordered by their natural call order
221
235
  // =====================================
@@ -272,18 +286,31 @@ export class BqSelect {
272
286
  return;
273
287
  const { multiple, inputElem, bqClear, el } = this;
274
288
  // Clear value and selected options
275
- this.value = undefined;
289
+ this.value = '';
276
290
  this.selectedOptions = [];
277
291
  // Clear display value and input element if not multiple
278
292
  if (!multiple) {
279
- this.displayValue = undefined;
280
- inputElem.value = undefined;
293
+ this.displayValue = '';
294
+ inputElem.value = '';
281
295
  }
282
296
  // Update form value and reset options visibility
283
297
  this.resetOptionsVisibility();
284
298
  // Emit clear event
285
299
  bqClear.emit(el);
286
300
  }
301
+ /**
302
+ * Resets the Select input to a previous value.
303
+ *
304
+ * @param {TSelectValue} value - The value to reset the Select input to.
305
+ * @return {Promise<void>}
306
+ * @memberof BqSelect
307
+ */
308
+ async reset(value) {
309
+ if (isNil(value))
310
+ return;
311
+ this.value = value;
312
+ this.syncItemsFromValue();
313
+ }
287
314
  // Local methods
288
315
  // Internal business logic.
289
316
  // These methods cannot be called from the host element.
@@ -336,19 +363,18 @@ export class BqSelect {
336
363
  this.selectedOptions = Array.from(selectedOptionsSet);
337
364
  this.value = this.selectedOptions.map((item) => item.value);
338
365
  };
339
- handleSearchFilter = (ev) => {
366
+ handleSearchFilter = (value) => {
340
367
  if (this.disabled)
341
368
  return;
342
369
  this.debounceQuery?.cancel();
343
- const query = ev.target.value?.toLowerCase().trim();
344
- if (!isDefined(query)) {
370
+ if (!isDefined(value)) {
345
371
  this.clear();
346
372
  }
347
373
  else {
348
374
  this.debounceQuery = debounce(() => {
349
375
  this.options.forEach((item) => {
350
376
  const itemLabel = this.getOptionLabel(item).toLowerCase();
351
- item.hidden = !itemLabel.includes(query);
377
+ item.hidden = !itemLabel.includes(value);
352
378
  });
353
379
  }, this.debounceTime);
354
380
  this.debounceQuery();
@@ -357,6 +383,20 @@ export class BqSelect {
357
383
  // so we need to make sure it's open when the user is typing and the query is not empty
358
384
  this.open = true;
359
385
  };
386
+ handleInput = (ev) => {
387
+ if (this.disabled)
388
+ return;
389
+ const { value } = ev.target;
390
+ this.debounceInput?.cancel();
391
+ this.debounceInput = debounce(() => {
392
+ const inputEvent = this.bqInput.emit({ value });
393
+ if (!inputEvent.defaultPrevented) {
394
+ // Continue with search filtering only if the event wasn't prevented
395
+ this.handleSearchFilter(value);
396
+ }
397
+ }, this.debounceTime);
398
+ this.debounceInput();
399
+ };
360
400
  handleClearClick = (ev) => {
361
401
  (async () => {
362
402
  await this.clear();
@@ -389,10 +429,8 @@ export class BqSelect {
389
429
  // Sync selected options for multiple selection mode
390
430
  this.selectedOptions = options.filter((option) => this.value?.includes(option.value));
391
431
  }
392
- else {
393
- // Sync display label for single selection mode
394
- this.updateDisplayLabel();
395
- }
432
+ // Always update display value and form value
433
+ this.updateDisplayLabel();
396
434
  internals.setFormValue(!isNil(value) ? `${value}` : undefined);
397
435
  };
398
436
  /**
@@ -470,19 +508,19 @@ export class BqSelect {
470
508
  // ===================================
471
509
  render() {
472
510
  const labelId = `bq-select__label-${this.name || this.fallbackInputId}`;
473
- return (h("div", { key: '54fefd4adb53a55b6c7d76c9a1919ecbb876db89', class: "bq-select", part: "base" }, h("label", { key: '5faf315825aaa24fc9f9a0ccfc2546c644ebdce4', id: labelId, class: { 'bq-select__label': true, '!hidden': !this.hasLabel }, "aria-label": this.name || this.fallbackInputId, htmlFor: this.name || this.fallbackInputId, ref: (labelElem) => (this.labelElem = labelElem), part: "label" }, h("slot", { key: '22c8fc40ae6f12f48f04704a147e66ea39c97dfe', name: "label", onSlotchange: this.handleSlotChange })), h("bq-dropdown", { key: 'f819daffb67ef979cfe826dd550551c9fa6cb665', class: "bq-select__dropdown w-full", disabled: this.disabled, distance: this.distance, keepOpenOnSelect: this.keepOpenOnSelect, open: this.open, panelHeight: this.panelHeight, placement: this.placement, sameWidth: this.sameWidth, skidding: this.skidding, strategy: this.strategy, exportparts: "panel" }, h("div", { key: '8a94629cdf8ab4b2676bebfbb7cc8ef8ecfe0358', class: {
511
+ return (h("div", { key: 'e35e24890bd19104389263f8894acf2c41c8187a', class: "bq-select", part: "base" }, h("label", { key: '844b0b36ce38685955d8a86496005a1b1f192328', id: labelId, class: { 'bq-select__label': true, '!hidden': !this.hasLabel }, "aria-label": this.name || this.fallbackInputId, htmlFor: this.name || this.fallbackInputId, ref: (labelElem) => (this.labelElem = labelElem), part: "label" }, h("slot", { key: '0d6b74970ccca1e3f2a90e342009811630ba8806', name: "label", onSlotchange: this.handleSlotChange })), h("bq-dropdown", { key: 'bcdd59a87e8dcdad4cf8745b914f0f075e640cbf', class: "bq-select__dropdown w-full", disabled: this.disabled, distance: this.distance, keepOpenOnSelect: this.keepOpenOnSelect, open: this.open, panelHeight: this.panelHeight, placement: this.placement, sameWidth: this.sameWidth, skidding: this.skidding, strategy: this.strategy, exportparts: "panel" }, h("div", { key: 'ed21456637eae3db7709df0190d007973d36b833', class: {
474
512
  'bq-select__control': true,
475
513
  [`validation-${this.validationStatus}`]: true,
476
514
  disabled: this.disabled,
477
- }, part: "control", slot: "trigger" }, h("span", { key: '15eb1db974488e7adbd9a36479130c1e448d4eb9', class: { 'bq-select__control--prefix': true, '!hidden': !this.hasPrefix }, ref: (spanElem) => (this.prefixElem = spanElem), part: "prefix" }, h("slot", { key: '91666cc3e54c8ed2f301110bf7df5270c9ded8d8', name: "prefix", onSlotchange: this.handleSlotChange })), h("div", { key: 'd1bd60d8adea2f859e5b427a92d7290140dba47f', class: "flex flex-1 overflow-x-auto", part: "input-outline" }, this.multiple && (h("span", { key: 'e0dbf3f5fece41c9ffbdac9da6d33879d1d3ac03', class: "bq-select__tags", part: "tags" }, h("slot", { key: '92490574a20077872e2147b550ed5bbdc05d4c2c', name: "tags" }, this.displayTags))), h("input", { key: '7e4b3d505c8ac28430fb6be03eca138baddbe1b4', id: this.name || this.fallbackInputId, class: "bq-select__control--input flex-grow is-full", autoComplete: "off", autoCapitalize: "off", "aria-disabled": this.disabled ? 'true' : 'false', "aria-controls": `bq-options-${this.name}`, "aria-expanded": this.open ? 'true' : 'false', "aria-haspopup": "listbox", disabled: this.disabled, form: this.form, name: this.name, placeholder: this.displayPlaceholder, ref: (inputElem) => (this.inputElem = inputElem), readOnly: this.readonly, required: this.required, role: "combobox", spellcheck: false, type: "text", value: this.displayValue, part: "input",
515
+ }, part: "control", slot: "trigger" }, h("span", { key: '3e4ca9629dc984d2ba989c648f73198af228f056', class: { 'bq-select__control--prefix': true, '!hidden': !this.hasPrefix }, ref: (spanElem) => (this.prefixElem = spanElem), part: "prefix" }, h("slot", { key: 'b78a369e3a25b0fdcfe8ee9b261c68cccf6758f0', name: "prefix", onSlotchange: this.handleSlotChange })), h("div", { key: 'b0071ca2c696b4e9c7487992ae8fcd91d960d550', class: "flex flex-1 overflow-x-auto", part: "input-outline" }, this.multiple && (h("span", { key: '163f9726c7e5a16982f272a61474872d3176ff3f', class: "bq-select__tags", part: "tags" }, h("slot", { key: '5158e01695ef3163eac77fac4564e95be690f00d', name: "tags" }, this.displayTags))), h("input", { key: '52539f694ab628d606ef6744a8a3cc36ea3d3cee', id: this.name || this.fallbackInputId, class: "bq-select__control--input flex-grow is-full", autoComplete: "off", autoCapitalize: "off", "aria-disabled": this.disabled ? 'true' : 'false', "aria-controls": `bq-options-${this.name}`, "aria-expanded": this.open ? 'true' : 'false', "aria-haspopup": "listbox", disabled: this.disabled, form: this.form, name: this.name, placeholder: this.displayPlaceholder, ref: (inputElem) => (this.inputElem = inputElem), readOnly: this.readonly, required: this.required, role: "combobox", spellcheck: false, type: "text", value: this.displayValue, part: "input",
478
516
  // Events
479
- onBlur: this.handleBlur, onFocus: this.handleFocus, onInput: this.handleSearchFilter })), this.hasClearIcon && (
517
+ onBlur: this.handleBlur, onFocus: this.handleFocus, onInput: this.handleInput })), this.hasClearIcon && (
480
518
  // The clear button will be visible as long as the input has a value
481
519
  // and the parent group is hovered or has focus-within
482
- h("bq-button", { key: '489b72502197f73126e096dfabb75f4602d7e11c', class: "bq-select__control--clear ms-[--bq-select--gap]", appearance: "text", "aria-label": this.clearButtonLabel, size: "small", onBqClick: this.handleClearClick, part: "clear-btn", exportparts: "button", tabIndex: -1 }, h("slot", { key: '9f37efce37949498a3f495d2b872f39aac704ee2', name: "clear-icon" }, h("bq-icon", { key: 'b06c78b1bd182f625c6c8e3316ebc384ef8daf04', name: "x-circle", class: "flex" })))), h("span", { key: '51bb355fb59997155683fc0187e5c68ad1843610', class: { 'bq-select__control--suffix': true, 'rotate-180': this.open, 'rotate-0': !this.open }, ref: (spanElem) => (this.suffixElem = spanElem), part: "suffix" }, h("slot", { key: '5c525f2daf4aa34ad9c2eb95a1e206fc6688a0a4', name: "suffix", onSlotchange: this.handleSlotChange }, h("bq-icon", { key: '5ecbd0c1ae4ab125303440364ff6507942a7e4bd', name: "caret-down", class: "flex" })))), h("bq-option-list", { key: 'cd5dc01161138dfbd1ba2e2909f8a21f7110c743', id: `bq-options-${this.name}`, onBqSelect: this.handleSelect, "aria-expanded": this.open ? 'true' : 'false', exportparts: "base:option-list", role: "listbox" }, h("slot", { key: '5988400ef3ea12f0777faf45190ebad0078347ca' }))), h("div", { key: '8c039deb1cfc92313ccef2577e02e54024295bd2', class: {
520
+ h("bq-button", { key: '1fb90179db5d4e181c3e71a0f4915811bf50360e', class: "bq-select__control--clear ms-[--bq-select--gap]", appearance: "text", "aria-label": this.clearButtonLabel, size: "small", onBqClick: this.handleClearClick, part: "clear-btn", exportparts: "button", tabIndex: -1 }, h("slot", { key: '223c40a006b7c411617cad57594bf77ee5024d69', name: "clear-icon" }, h("bq-icon", { key: 'd5283c3c50a47e8331ae7685c6b908cd1103f890', name: "x-circle", class: "flex" })))), h("span", { key: '54ad1a8fd54e1a222592d2c350b2a4622abdc611', class: { 'bq-select__control--suffix': true, 'rotate-180': this.open, 'rotate-0': !this.open }, ref: (spanElem) => (this.suffixElem = spanElem), part: "suffix" }, h("slot", { key: 'ea46a8e2622ad8f1cd37c670af7efff266ca8a28', name: "suffix", onSlotchange: this.handleSlotChange }, h("bq-icon", { key: 'ae849775777ed7ac51e4da87a51973a591306320', name: "caret-down", class: "flex" })))), h("bq-option-list", { key: '8bc1795e7e6a752d1f8b495546e0c18e84b76df7', id: `bq-options-${this.name}`, onBqSelect: this.handleSelect, "aria-expanded": this.open ? 'true' : 'false', exportparts: "base:option-list", role: "listbox" }, h("slot", { key: 'bb8f93be2f520a514a9f458b4c9794143fc7a7ac' }))), h("div", { key: '5c0319bc96533b89133e17a9c32421ad0207ca7f', class: {
483
521
  [`bq-select__helper-text validation-${this.validationStatus}`]: true,
484
522
  '!hidden': !this.hasHelperText,
485
- }, ref: (divElem) => (this.helperTextElem = divElem), part: "helper-text" }, h("slot", { key: 'b9a38f242841da7e4ca1e40c21cdb48cdcd2364a', name: "helper-text", onSlotchange: this.handleSlotChange }))));
523
+ }, ref: (divElem) => (this.helperTextElem = divElem), part: "helper-text" }, h("slot", { key: '15c8dd752535e8f7850ce7c35f0c72310c234e4b', name: "helper-text", onSlotchange: this.handleSlotChange }))));
486
524
  }
487
525
  static get is() { return "bq-select"; }
488
526
  static get encapsulation() { return "shadow"; }
@@ -938,7 +976,7 @@ export class BqSelect {
938
976
  "references": {
939
977
  "TSelectValue": {
940
978
  "location": "local",
941
- "path": "/Users/dramos/PROJECTs/ENDAVA/BEEQ-Design-System/packages/beeq/src/components/select/bq-select.tsx",
979
+ "path": "/home/runner/work/BEEQ/BEEQ/packages/beeq/src/components/select/bq-select.tsx",
942
980
  "id": "../../packages/beeq/src/components/select/bq-select.tsx::TSelectValue"
943
981
  }
944
982
  }
@@ -1047,6 +1085,21 @@ export class BqSelect {
1047
1085
  }
1048
1086
  }
1049
1087
  }
1088
+ }, {
1089
+ "method": "bqInput",
1090
+ "name": "bqInput",
1091
+ "bubbles": true,
1092
+ "cancelable": true,
1093
+ "composed": true,
1094
+ "docs": {
1095
+ "tags": [],
1096
+ "text": "Callback handler emitted when the Select input changes its value while typing"
1097
+ },
1098
+ "complexType": {
1099
+ "original": "{ value: string | number | string[] }",
1100
+ "resolved": "{ value: string | number | string[]; }",
1101
+ "references": {}
1102
+ }
1050
1103
  }];
1051
1104
  }
1052
1105
  static get methods() {
@@ -1073,6 +1126,41 @@ export class BqSelect {
1073
1126
  "text": "BqSelect"
1074
1127
  }]
1075
1128
  }
1129
+ },
1130
+ "reset": {
1131
+ "complexType": {
1132
+ "signature": "(value: TSelectValue) => Promise<void>",
1133
+ "parameters": [{
1134
+ "name": "value",
1135
+ "type": "string | string[]",
1136
+ "docs": "- The value to reset the Select input to."
1137
+ }],
1138
+ "references": {
1139
+ "Promise": {
1140
+ "location": "global",
1141
+ "id": "global::Promise"
1142
+ },
1143
+ "TSelectValue": {
1144
+ "location": "local",
1145
+ "path": "/home/runner/work/BEEQ/BEEQ/packages/beeq/src/components/select/bq-select.tsx",
1146
+ "id": "../../packages/beeq/src/components/select/bq-select.tsx::TSelectValue"
1147
+ }
1148
+ },
1149
+ "return": "Promise<void>"
1150
+ },
1151
+ "docs": {
1152
+ "text": "Resets the Select input to a previous value.",
1153
+ "tags": [{
1154
+ "name": "param",
1155
+ "text": "value - The value to reset the Select input to."
1156
+ }, {
1157
+ "name": "return",
1158
+ "text": undefined
1159
+ }, {
1160
+ "name": "memberof",
1161
+ "text": "BqSelect"
1162
+ }]
1163
+ }
1076
1164
  }
1077
1165
  };
1078
1166
  }
@@ -1 +1 @@
1
- {"version":3,"file":"bq-select.js","sourceRoot":"","sources":["../../../../../../packages/beeq/src/components/select/bq-select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAIlH,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,EAAa,MAAM,oBAAoB,CAAC;AAKpH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwGG;AASH,MAAM,OAAO,QAAQ;IACnB,iBAAiB;IACjB,uBAAuB;IAEf,cAAc,CAAe;IAC7B,SAAS,CAAoB;IAC7B,SAAS,CAAe;IACxB,UAAU,CAAe;IACzB,UAAU,CAAe;IAEzB,aAAa,CAAkB;IAE/B,eAAe,GAAG,QAAQ,CAAC;IAEnC,iCAAiC;IACjC,sCAAsC;IAE3B,EAAE,CAAuB;IACjB,SAAS,CAAoB;IAEhD,oBAAoB;IACpB,wCAAwC;IACxC,0CAA0C;IAEjC,YAAY,CAAU;IACtB,aAAa,GAAG,KAAK,CAAC;IACtB,eAAe,GAA0B,EAAE,CAAC;IAE5C,QAAQ,GAAG,KAAK,CAAC;IACjB,SAAS,GAAG,KAAK,CAAC;IAClB,SAAS,GAAG,KAAK,CAAC;IAClB,QAAQ,GAAG,KAAK,CAAC;IA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CAAC,gBAAgB,EAAE,CAAC,EAAE,IAAI;oBACpE,SAAS,EAAE,CAAC,IAAI,CAAC,aAAa;iBAC/B,EACD,GAAG,EAAE,CAAC,OAAuB,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,EACjE,IAAI,EAAC,aAAa;gBAElB,6DAAM,IAAI,EAAC,aAAa,EAAC,YAAY,EAAE,IAAI,CAAC,gBAAgB,GAAI,CAC5D,CACF,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { AttachInternals, Component, Element, Event, h, Listen, Method, Prop, State, Watch } from '@stencil/core';\nimport type { EventEmitter } from '@stencil/core';\n\nimport type { Placement } from '../../services/interfaces';\nimport { debounce, hasSlotContent, isDefined, isHTMLElement, isNil, isString, TDebounce } from '../../shared/utils';\nimport type { TInputValidation } from '../input/bq-input.types';\n\nexport type TSelectValue = string | string[];\n\n/**\n * The select input component lets users choose from a predefined list, commonly used in forms for easy data selection.\n *\n * @example How to use it\n * ```html\n * <bq-select placeholder=\"Placeholder\">\n * <label slot=\"label\">Select label</label>\n * <span slot=\"helper-text\">\n * <bq-icon name=\"star\"></bq-icon>\n * Helper text\n * </span>\n *\n * <bq-option value=\"1\">Option 1</bq-option>\n * <bq-option value=\"2\">Option 2</bq-option>\n * <bq-option value=\"3\">Option 3</bq-option>\n * </bq-select>\n * ```\n *\n * @documentation https://www.beeq.design/3d466e231/p/41989d-select/b/09d7b1\n * @status stable\n *\n * @dependency bq-button\n * @dependency bq-dropdown\n * @dependency bq-icon\n * @dependency bq-option-list\n * @dependency bq-tag\n *\n * @attr {boolean} autofocus - If `true`, the Select input will be focused on component render.\n * @attr {string} clear-button-label - The clear button aria label.\n * @attr {number} debounce-time - The amount of time, in milliseconds, to wait before emitting the `bqInput` event after the input value changes.\n * @attr {boolean} disable-clear - If `true`, the clear button won't be displayed.\n * @attr {boolean} disabled - Indicates whether the Select input is disabled and cannot be interacted with.\n * @attr {number} distance - Represents the distance (gutter or margin) between the Select panel and the input element.\n * @attr {string} form - The ID of the form that Select input field belongs to.\n * @attr {boolean} keep-open-on-select - If `true`, the Select panel will remain open after a selection is made.\n * @attr {number} max-tags-visible - The maximum number of tags to display when multiple selection is enabled.\n * @attr {boolean} multiple - If `true`, the Select input will allow multiple selections.\n * @attr {string} name - The Select input name.\n * @attr {boolean} open - If `true`, the Select panel will be visible.\n * @attr {string} panel-height - When set, it will override the height of the Select panel.\n * @attr {string} placeholder - The Select input placeholder text value.\n * @attr {\"bottom\" | \"bottom-end\" | \"bottom-start\" | \"left\" | \"left-end\" | \"left-start\" | \"right\" | \"right-end\" | \"right-start\" | \"top\" | \"top-end\" | \"top-start\"} placement - Position of the Select panel.\n * @attr {boolean} readonly - If `true`, the Select input cannot be modified.\n * @attr {boolean} required - Indicates whether or not the Select input is required to be filled out before submitting the form.\n * @attr {boolean} same-width - Whether the panel should have the Select same width as the input element.\n * @attr {number} skidding - Represents the skidding between the Select panel and the input element.\n * @attr {\"absolute\" | \"fixed\"} strategy - Defines the strategy to position the Select panel.\n * @attr {\"error\" | \"success\" | \"warning\" | \"none\"} validation-status - The validation status of the Select input.\n * @attr {\"number\" | \"string\" | \"string[]\"} value - The select input value can be used to reset the field to a previous value.\n *\n * @method clear - Method to be called to clear the selected value.\n *\n * @event bqBlur - The callback handler is emitted when the Select input loses focus.\n * @event bqClear - The callback handler is emitted when the selected value has been cleared.\n * @event bqFocus - A callback handler is emitted when the Select input has received focus.\n * @event bqSelect - The callback handler is emitted when the selected value has changed.\n *\n * @slot label - The label slot container.\n * @slot prefix - The prefix slot container.\n * @slot tags - The tags slot container.\n * @slot clear-icon - The clear icon slot container.\n * @slot suffix - The suffix slot container.\n * @slot helper-text - The helper text slot container.\n *\n * @part base - The component's base wrapper.\n * @part button - The native HTML button used under the hood in the clear button.\n * @part clear-btn - The clear button.\n * @part control - The input control wrapper.\n * @part input-outline - The input outline wrapper that holds the tags container and the native HTML input used under the hood.\n * @part helper-text - The helper text slot container.\n * @part input - The native HTML input element used under the hood.\n * @part label - The label slot container.\n * @part panel - The select panel container\n * @part prefix - The prefix slot container.\n * @part suffix - The suffix slot container.\n * @part tags - The tags container of the BqTags for multiple selection.\n * @part tag - The tag container of the BqTag for multiple selection.\n * @part tag__base - The base wrapper of the BqTag for multiple selection.\n * @part tag__prefix - The prefix slot container of the BqTag for multiple selection.\n * @part tag__text - The text slot container of the BqTag for multiple selection.\n * @part tag__btn-close - The close button of the BqTag for multiple selection.\n * @part option-list - The option list container.\n *\n * @cssprop --bq-select--background-color - Select background color\n * @cssprop --bq-select--border-color - Select border color\n * @cssprop --bq-select--border-color-focus - Select border color on focus\n * @cssprop --bq-select--border-color-disabled - Select border color when disabled\n * @cssprop --bq-select--border-radius - Select border radius\n * @cssprop --bq-select--border-width - Select border width\n * @cssprop --bq-select--border-style - Select border style\n * @cssprop --bq-select--gap - Gap between Select content and prefix/suffix\n * @cssprop --bq-select--helper-margin-top - Helper text margin top\n * @cssprop --bq-select--helper-text-color - Helper text color\n * @cssprop --bq-select--helper-text-size - Helper text size\n * @cssprop --bq-select--icon-size - Icon size to use in prefix/suffix and clear button\n * @cssprop --bq-select--label-margin-bottom - Select label margin bottom\n * @cssprop --bq-select--label-text-color - Select label text color\n * @cssprop --bq-select--label-text-size - Select label text size\n * @cssprop --bq-select--padding-start - Select padding start\n * @cssprop --bq-select--padding-end - Select padding end\n * @cssprop --bq-select--paddingY - Select padding top and bottom\n * @cssprop --bq-select--text-color - Select text color\n * @cssprop --bq-select--text-size - Select text size\n * @cssprop --bq-select--text-placeholder-color - Select placeholder text color\n */\n@Component({\n tag: 'bq-select',\n styleUrl: './scss/bq-select.scss',\n formAssociated: true,\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class BqSelect {\n // Own Properties\n // ====================\n\n private helperTextElem?: HTMLElement;\n private inputElem?: HTMLInputElement;\n private labelElem?: HTMLElement;\n private prefixElem?: HTMLElement;\n private suffixElem?: HTMLElement;\n\n private debounceQuery: TDebounce<void>;\n\n private fallbackInputId = 'select';\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqSelectElement;\n @AttachInternals() internals!: ElementInternals;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() displayValue?: string;\n @State() hasHelperText = false;\n @State() selectedOptions: HTMLBqOptionElement[] = [];\n\n @State() hasLabel = false;\n @State() hasPrefix = false;\n @State() hasSuffix = false;\n @State() hasValue = false;\n\n // Public Property API\n // ========================\n\n /** If true, the Select input will be focused on component render */\n @Prop({ reflect: true }) autofocus: boolean;\n\n /** The clear button aria label */\n @Prop({ reflect: true }) clearButtonLabel? = 'Clear value';\n\n /**\n * The amount of time, in milliseconds, to wait before emitting the `bqInput` event after the input value changes.\n * A value of 0 means no debouncing will occur.\n */\n @Prop({ reflect: true, mutable: true }) debounceTime? = 0;\n\n /**\n * Indicates whether the Select input is disabled or not.\n * If `true`, the Select is disabled and cannot be interacted with.\n */\n @Prop({ mutable: true }) disabled?: boolean = false;\n\n /** If true, the clear button won't be displayed */\n @Prop({ reflect: true }) disableClear? = false;\n\n /** Represents the distance (gutter or margin) between the Select panel and the input element. */\n @Prop({ reflect: true }) distance?: number = 8;\n\n /** The ID of the form that the Select input belongs to. */\n @Prop({ reflect: true }) form?: string;\n\n /** If true, the Select panel will remain open after a selection is made. */\n @Prop({ reflect: true }) keepOpenOnSelect?: boolean = false;\n\n /** The Select input name. */\n @Prop({ reflect: true }) name!: string;\n\n /** The maximum number of tags to display when multiple selection is enabled */\n @Prop({ mutable: true }) maxTagsVisible: number = 2;\n\n /** If true, the Select input will allow multiple selections. */\n @Prop({ reflect: true }) multiple?: boolean = false;\n\n /** If true, the Select panel will be visible. */\n @Prop({ reflect: true, mutable: true }) open?: boolean = false;\n\n /** When set, it will override the height of the Select panel. */\n @Prop({ reflect: true }) panelHeight?: string;\n\n /** The Select input placeholder text value */\n @Prop({ reflect: true }) placeholder?: string;\n\n /** Position of the Select panel */\n @Prop({ reflect: true }) placement?: Placement = 'bottom';\n\n /** If true, the list of options cannot be filtered (searching won't be available) */\n @Prop({ reflect: true }) readonly?: boolean;\n\n /** Indicates whether or not the Select input is required to be filled out before submitting the form. */\n @Prop({ reflect: true }) required?: boolean;\n\n /** Whether the panel should have the Select same width as the input element */\n @Prop({ reflect: true }) sameWidth?: boolean = true;\n\n /** Represents the skidding between the Select panel and the input element. */\n @Prop({ reflect: true }) skidding?: number = 0;\n\n /** Defines the strategy to position the Select panel */\n @Prop({ reflect: true }) strategy?: 'fixed' | 'absolute' = 'fixed';\n\n /**\n * The validation status of the Select input.\n *\n * @remarks\n * This property is used to indicate the validation status of the select input. It can be set to one of the following values:\n * - `'none'`: No validation status is set.\n * - `'error'`: The input has a validation error.\n * - `'warning'`: The input has a validation warning.\n * - `'success'`: The input has passed validation.\n */\n @Prop({ reflect: true }) validationStatus: TInputValidation = 'none';\n\n /** The select input value, it can be used to reset the field to a previous value */\n @Prop({ reflect: true, mutable: true }) value: TSelectValue;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('value')\n handleValueChange() {\n if (this.multiple && isString(this.value)) {\n // NOTE: we ensure that value is an array, changing the value will trigger Watch to execute thus the return\n this.value = Array.from(JSON.parse(String(this.value)));\n this.internals.setFormValue(this.value.join(','));\n return;\n }\n\n this.syncItemsFromValue();\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Callback handler emitted when the Select input loses focus */\n @Event() bqBlur!: EventEmitter<HTMLBqSelectElement>;\n\n /** Callback handler emitted when the selected value has been cleared */\n @Event() bqClear!: EventEmitter<HTMLBqSelectElement>;\n\n /** Callback handler emitted when the Select input has received focus */\n @Event() bqFocus!: EventEmitter<HTMLBqSelectElement>;\n\n /** Callback handler emitted when the selected value has changed */\n @Event() bqSelect!: EventEmitter<{ value: string | number | string[]; item: HTMLBqOptionElement }>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n connectedCallback() {\n this.initMultipleValue();\n }\n\n componentWillLoad() {\n this.initMultipleValue();\n }\n\n componentDidLoad() {\n this.handleSlotChange();\n\n if (this.multiple && Array.isArray(this.value)) {\n this.selectedOptions = this.options.filter((item) => this.value.includes(item.value));\n }\n this.handleValueChange();\n }\n\n formAssociatedCallback() {\n this.internals.role = 'combobox';\n this.internals.ariaExpanded = this.open ? 'true' : 'false';\n }\n\n async formResetCallback() {\n if (isNil(this.value)) return;\n\n this.internals.setValidity({});\n this.clear();\n }\n\n // Listeners\n // ==============\n\n @Listen('bqOpen', { capture: true })\n handleOpenChange(ev: CustomEvent<{ open: boolean }>) {\n if (!ev.composedPath().includes(this.el)) return;\n\n this.open = ev.detail.open;\n }\n\n @Listen('bqFocus', { capture: true })\n @Listen('bqBlur', { capture: true })\n stopOptionFocusBlurPropagation(ev: CustomEvent) {\n // Stop propagation of focus and blur events coming from the `bq-option` elements\n if (isHTMLElement(ev.target, 'bq-select')) return;\n\n ev.stopPropagation();\n }\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n /**\n * Clears the selected value.\n *\n * @return {Promise<void>}\n * @memberof BqSelect\n */\n @Method()\n async clear(): Promise<void> {\n if (this.disabled) return;\n\n const { multiple, inputElem, bqClear, el } = this;\n\n // Clear value and selected options\n this.value = undefined;\n this.selectedOptions = [];\n\n // Clear display value and input element if not multiple\n if (!multiple) {\n this.displayValue = undefined;\n inputElem.value = undefined;\n }\n\n // Update form value and reset options visibility\n this.resetOptionsVisibility();\n\n // Emit clear event\n bqClear.emit(el);\n }\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private initMultipleValue = () => {\n if (!this.multiple) return;\n\n this.value = Array.isArray(this.value) ? this.value : Array.from(JSON.parse(String(this.value)));\n };\n\n private handleBlur = () => {\n if (this.disabled) return;\n\n this.bqBlur.emit(this.el);\n };\n\n private handleFocus = () => {\n if (this.disabled) return;\n\n this.bqFocus.emit(this.el);\n };\n\n private handleSelect = (ev: CustomEvent<{ value: TSelectValue; item: HTMLBqOptionElement }>) => {\n if (this.disabled) return;\n\n if (this.multiple) {\n ev.stopPropagation();\n }\n\n const { value, item } = ev.detail;\n\n if (this.multiple) {\n this.handleMultipleSelection(item);\n // Clear the input value after selecting an item\n this.inputElem.value = '';\n // If multiple selection is enabled, emit the selected items array instead of relying on\n // the option list to emit the value of the selected item\n this.bqSelect.emit({ value: this.value, item });\n } else {\n this.value = value;\n }\n\n this.resetOptionsVisibility();\n this.inputElem.focus();\n };\n\n private handleMultipleSelection = (item: HTMLBqOptionElement) => {\n // Set has O(1) complexity for insertion, deletion, and search operations, compared to an Array's O(n)\n const selectedOptionsSet = new Set(this.selectedOptions);\n\n if (selectedOptionsSet.has(item)) {\n selectedOptionsSet.delete(item);\n } else {\n selectedOptionsSet.add(item);\n }\n\n this.selectedOptions = Array.from(selectedOptionsSet);\n this.value = this.selectedOptions.map((item) => item.value);\n };\n\n private handleSearchFilter = (ev: Event) => {\n if (this.disabled) return;\n\n this.debounceQuery?.cancel();\n\n const query = (ev.target as HTMLInputElement).value?.toLowerCase().trim();\n\n if (!isDefined(query)) {\n this.clear();\n } else {\n this.debounceQuery = debounce(() => {\n this.options.forEach((item: HTMLBqOptionElement) => {\n const itemLabel = this.getOptionLabel(item).toLowerCase();\n item.hidden = !itemLabel.includes(query);\n });\n }, this.debounceTime);\n\n this.debounceQuery();\n }\n\n // The panel will close once a selection is made\n // so we need to make sure it's open when the user is typing and the query is not empty\n this.open = true;\n };\n\n private handleClearClick = (ev: CustomEvent) => {\n (async () => {\n await this.clear();\n })();\n this.inputElem.focus();\n\n ev.stopPropagation();\n };\n\n private handleTagRemove = (item: HTMLBqOptionElement) => {\n if (this.disabled) return;\n\n this.handleMultipleSelection(item);\n this.bqSelect.emit({ value: this.value, item });\n };\n\n private handleSlotChange = () => {\n this.hasLabel = hasSlotContent(this.labelElem);\n this.hasPrefix = hasSlotContent(this.prefixElem);\n this.hasSuffix = hasSlotContent(this.suffixElem);\n this.hasHelperText = hasSlotContent(this.helperTextElem);\n };\n\n private resetOptionsVisibility = () => {\n this.options.forEach((item: HTMLBqOptionElement) => (item.hidden = false));\n };\n\n private syncItemsFromValue = () => {\n const { internals, options, value } = this;\n if (!options.length) return;\n\n // Sync selected state of the BqOption elements\n this.syncSelectedOptionsState();\n\n if (this.multiple) {\n // Sync selected options for multiple selection mode\n this.selectedOptions = options.filter((option) => this.value?.includes(option.value));\n } else {\n // Sync display label for single selection mode\n this.updateDisplayLabel();\n }\n\n internals.setFormValue(!isNil(value) ? `${value}` : undefined);\n };\n\n /**\n * Syncs the selected state of the BqOption elements which value is included in the `value` property.\n * Notice that value can be a string or an array of strings.\n *\n * @private\n * @memberof BqSelect\n */\n private syncSelectedOptionsState = () => {\n const { options, multiple, value } = this;\n const lowerCaseValue = String(value).toLowerCase();\n\n options.forEach((option: HTMLBqOptionElement) => {\n if (multiple && Array.isArray(value)) {\n option.selected = value.includes(option.value);\n } else {\n option.selected = option.value.toLowerCase() === lowerCaseValue;\n }\n });\n };\n\n /**\n * Updates the display value of the input element based on the selected option.\n *\n * @private\n * @memberof BqSelect\n */\n private updateDisplayLabel = () => {\n const { value, options, inputElem } = this;\n\n const checkedItem = options.find((item) => item.value === value);\n const displayValue = checkedItem ? this.getOptionLabel(checkedItem) : '';\n\n inputElem.value = displayValue;\n this.displayValue = displayValue;\n };\n\n private getOptionLabel = (item: HTMLBqOptionElement) => {\n if (!item) return '';\n return item.innerText.trim() ?? '';\n };\n\n private get options() {\n return Array.from(this.el.querySelectorAll('bq-option'));\n }\n\n private get displayPlaceholder() {\n // Hide the placeholder when multiple selection is enabled and there are selected items\n return this.multiple && this.selectedOptions.length !== 0 ? undefined : this.placeholder;\n }\n\n private get displayTags() {\n return this.selectedOptions.map((item, index) => {\n if (index < this.maxTagsVisible || this.maxTagsVisible < 0) {\n return (\n <bq-tag\n key={item.value}\n removable\n size=\"xsmall\"\n variant=\"filled\"\n onBqClose={(event) => {\n // NOTE: prevents triggering bqClose on parent\n event.stopPropagation();\n this.handleTagRemove(item);\n }}\n // Prevent the tag from closing the panel when clicked\n onClick={(ev: MouseEvent) => ev.stopPropagation()}\n exportparts=\"wrapper:tag__base,prefix:tag__prefix,text:tag__text,btn-close:tag__btn-close\"\n part=\"tag\"\n >\n {this.getOptionLabel(item)}\n </bq-tag>\n );\n } else if (index === this.maxTagsVisible) {\n return (\n <bq-tag\n key=\"more\"\n size=\"xsmall\"\n variant=\"filled\"\n exportparts=\"wrapper:tag__base,prefix:tag__prefix,text:tag__text,btn-close:tag__btn-close\"\n part=\"tag\"\n >\n +{this.selectedOptions.length - index}\n </bq-tag>\n );\n }\n\n return null;\n });\n }\n\n private get hasClearIcon() {\n if (this.disableClear || this.disabled) {\n return false;\n }\n\n if (this.multiple) {\n return this.selectedOptions.length > 0;\n }\n\n return isDefined(this.displayValue);\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const labelId = `bq-select__label-${this.name || this.fallbackInputId}`;\n\n return (\n <div class=\"bq-select\" part=\"base\">\n {/* Label */}\n <label\n id={labelId}\n class={{ 'bq-select__label': true, '!hidden': !this.hasLabel }}\n aria-label={this.name || this.fallbackInputId}\n htmlFor={this.name || this.fallbackInputId}\n ref={(labelElem: HTMLSpanElement) => (this.labelElem = labelElem)}\n part=\"label\"\n >\n <slot name=\"label\" onSlotchange={this.handleSlotChange} />\n </label>\n {/* Select dropdown */}\n <bq-dropdown\n class=\"bq-select__dropdown w-full\"\n disabled={this.disabled}\n distance={this.distance}\n keepOpenOnSelect={this.keepOpenOnSelect}\n open={this.open}\n panelHeight={this.panelHeight}\n placement={this.placement}\n sameWidth={this.sameWidth}\n skidding={this.skidding}\n strategy={this.strategy}\n exportparts=\"panel\"\n >\n {/* Input control group */}\n <div\n class={{\n 'bq-select__control': true,\n [`validation-${this.validationStatus}`]: true,\n disabled: this.disabled,\n }}\n part=\"control\"\n slot=\"trigger\"\n >\n {/* Prefix */}\n <span\n class={{ 'bq-select__control--prefix': true, '!hidden': !this.hasPrefix }}\n ref={(spanElem: HTMLSpanElement) => (this.prefixElem = spanElem)}\n part=\"prefix\"\n >\n <slot name=\"prefix\" onSlotchange={this.handleSlotChange} />\n </span>\n <div class=\"flex flex-1 overflow-x-auto\" part=\"input-outline\">\n {/* Display selected values using BqTags for multiple selection */}\n {this.multiple && (\n <span class=\"bq-select__tags\" part=\"tags\">\n <slot name=\"tags\">{this.displayTags}</slot>\n </span>\n )}\n {/* HTML Input */}\n <input\n id={this.name || this.fallbackInputId}\n class=\"bq-select__control--input flex-grow is-full\"\n autoComplete=\"off\"\n autoCapitalize=\"off\"\n aria-disabled={this.disabled ? 'true' : 'false'}\n aria-controls={`bq-options-${this.name}`}\n aria-expanded={this.open ? 'true' : 'false'}\n aria-haspopup=\"listbox\"\n disabled={this.disabled}\n form={this.form}\n name={this.name}\n placeholder={this.displayPlaceholder}\n ref={(inputElem: HTMLInputElement) => (this.inputElem = inputElem)}\n readOnly={this.readonly}\n required={this.required}\n role=\"combobox\"\n spellcheck={false}\n type=\"text\"\n value={this.displayValue}\n part=\"input\"\n // Events\n onBlur={this.handleBlur}\n onFocus={this.handleFocus}\n onInput={this.handleSearchFilter}\n />\n </div>\n {/* Clear Button */}\n {this.hasClearIcon && (\n // The clear button will be visible as long as the input has a value\n // and the parent group is hovered or has focus-within\n <bq-button\n class=\"bq-select__control--clear ms-[--bq-select--gap]\"\n appearance=\"text\"\n aria-label={this.clearButtonLabel}\n size=\"small\"\n onBqClick={this.handleClearClick}\n part=\"clear-btn\"\n exportparts=\"button\"\n tabIndex={-1}\n >\n <slot name=\"clear-icon\">\n <bq-icon name=\"x-circle\" class=\"flex\" />\n </slot>\n </bq-button>\n )}\n {/* Suffix */}\n <span\n class={{ 'bq-select__control--suffix': true, 'rotate-180': this.open, 'rotate-0': !this.open }}\n ref={(spanElem: HTMLSpanElement) => (this.suffixElem = spanElem)}\n part=\"suffix\"\n >\n <slot name=\"suffix\" onSlotchange={this.handleSlotChange}>\n <bq-icon name=\"caret-down\" class=\"flex\" />\n </slot>\n </span>\n </div>\n <bq-option-list\n id={`bq-options-${this.name}`}\n onBqSelect={this.handleSelect}\n aria-expanded={this.open ? 'true' : 'false'}\n exportparts=\"base:option-list\"\n role=\"listbox\"\n >\n <slot />\n </bq-option-list>\n </bq-dropdown>\n {/* Helper text */}\n <div\n class={{\n [`bq-select__helper-text validation-${this.validationStatus}`]: true,\n '!hidden': !this.hasHelperText,\n }}\n ref={(divElem: HTMLDivElement) => (this.helperTextElem = divElem)}\n part=\"helper-text\"\n >\n <slot name=\"helper-text\" onSlotchange={this.handleSlotChange} />\n </div>\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"bq-select.js","sourceRoot":"","sources":["../../../../../../packages/beeq/src/components/select/bq-select.tsx"],"names":[],"mapp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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { AttachInternals, Component, Element, Event, h, Listen, Method, Prop, State, Watch } from '@stencil/core';\nimport type { EventEmitter } from '@stencil/core';\n\nimport type { Placement } from '../../services/interfaces';\nimport {\n debounce,\n hasSlotContent,\n isDefined,\n isHTMLElement,\n isNil,\n stringToArray,\n TDebounce,\n} from '../../shared/utils';\nimport type { TInputValidation } from '../input/bq-input.types';\n\nexport type TSelectValue = string | string[];\n\n/**\n * The select input component lets users choose from a predefined list, commonly used in forms for easy data selection.\n *\n * @example How to use it\n * ```html\n * <bq-select placeholder=\"Placeholder\">\n * <label slot=\"label\">Select label</label>\n * <span slot=\"helper-text\">\n * <bq-icon name=\"star\"></bq-icon>\n * Helper text\n * </span>\n *\n * <bq-option value=\"1\">Option 1</bq-option>\n * <bq-option value=\"2\">Option 2</bq-option>\n * <bq-option value=\"3\">Option 3</bq-option>\n * </bq-select>\n * ```\n *\n * @documentation https://www.beeq.design/3d466e231/p/41989d-select/b/09d7b1\n * @status stable\n *\n * @dependency bq-button\n * @dependency bq-dropdown\n * @dependency bq-icon\n * @dependency bq-option-list\n * @dependency bq-tag\n *\n * @attr {boolean} autofocus - If `true`, the Select input will be focused on component render.\n * @attr {string} clear-button-label - The clear button aria label.\n * @attr {number} debounce-time - The amount of time, in milliseconds, to wait before emitting the `bqInput` event after the input value changes.\n * @attr {boolean} disable-clear - If `true`, the clear button won't be displayed.\n * @attr {boolean} disabled - Indicates whether the Select input is disabled and cannot be interacted with.\n * @attr {number} distance - Represents the distance (gutter or margin) between the Select panel and the input element.\n * @attr {string} form - The ID of the form that Select input field belongs to.\n * @attr {boolean} keep-open-on-select - If `true`, the Select panel will remain open after a selection is made.\n * @attr {number} max-tags-visible - The maximum number of tags to display when multiple selection is enabled.\n * @attr {boolean} multiple - If `true`, the Select input will allow multiple selections.\n * @attr {string} name - The Select input name.\n * @attr {boolean} open - If `true`, the Select panel will be visible.\n * @attr {string} panel-height - When set, it will override the height of the Select panel.\n * @attr {string} placeholder - The Select input placeholder text value.\n * @attr {\"bottom\" | \"bottom-end\" | \"bottom-start\" | \"left\" | \"left-end\" | \"left-start\" | \"right\" | \"right-end\" | \"right-start\" | \"top\" | \"top-end\" | \"top-start\"} placement - Position of the Select panel.\n * @attr {boolean} readonly - If `true`, the Select input cannot be modified.\n * @attr {boolean} required - Indicates whether or not the Select input is required to be filled out before submitting the form.\n * @attr {boolean} same-width - Whether the panel should have the Select same width as the input element.\n * @attr {number} skidding - Represents the skidding between the Select panel and the input element.\n * @attr {\"absolute\" | \"fixed\"} strategy - Defines the strategy to position the Select panel.\n * @attr {\"error\" | \"success\" | \"warning\" | \"none\"} validation-status - The validation status of the Select input.\n * @attr {\"number\" | \"string\" | \"string[]\"} value - The select input value can be used to reset the field to a previous value.\n *\n * @method clear - Method to be called to clear the selected value.\n *\n * @event bqBlur - The callback handler is emitted when the Select input loses focus.\n * @event bqClear - The callback handler is emitted when the selected value has been cleared.\n * @event bqFocus - A callback handler is emitted when the Select input has received focus.\n * @event bqSelect - The callback handler is emitted when the selected value has changed.\n *\n * @slot label - The label slot container.\n * @slot prefix - The prefix slot container.\n * @slot tags - The tags slot container.\n * @slot clear-icon - The clear icon slot container.\n * @slot suffix - The suffix slot container.\n * @slot helper-text - The helper text slot container.\n *\n * @part base - The component's base wrapper.\n * @part button - The native HTML button used under the hood in the clear button.\n * @part clear-btn - The clear button.\n * @part control - The input control wrapper.\n * @part input-outline - The input outline wrapper that holds the tags container and the native HTML input used under the hood.\n * @part helper-text - The helper text slot container.\n * @part input - The native HTML input element used under the hood.\n * @part label - The label slot container.\n * @part panel - The select panel container\n * @part prefix - The prefix slot container.\n * @part suffix - The suffix slot container.\n * @part tags - The tags container of the BqTags for multiple selection.\n * @part tag - The tag container of the BqTag for multiple selection.\n * @part tag__base - The base wrapper of the BqTag for multiple selection.\n * @part tag__prefix - The prefix slot container of the BqTag for multiple selection.\n * @part tag__text - The text slot container of the BqTag for multiple selection.\n * @part tag__btn-close - The close button of the BqTag for multiple selection.\n * @part option-list - The option list container.\n *\n * @cssprop --bq-select--background-color - Select background color\n * @cssprop --bq-select--border-color - Select border color\n * @cssprop --bq-select--border-color-focus - Select border color on focus\n * @cssprop --bq-select--border-color-disabled - Select border color when disabled\n * @cssprop --bq-select--border-radius - Select border radius\n * @cssprop --bq-select--border-width - Select border width\n * @cssprop --bq-select--border-style - Select border style\n * @cssprop --bq-select--gap - Gap between Select content and prefix/suffix\n * @cssprop --bq-select--helper-margin-top - Helper text margin top\n * @cssprop --bq-select--helper-text-color - Helper text color\n * @cssprop --bq-select--helper-text-size - Helper text size\n * @cssprop --bq-select--icon-size - Icon size to use in prefix/suffix and clear button\n * @cssprop --bq-select--label-margin-bottom - Select label margin bottom\n * @cssprop --bq-select--label-text-color - Select label text color\n * @cssprop --bq-select--label-text-size - Select label text size\n * @cssprop --bq-select--padding-start - Select padding start\n * @cssprop --bq-select--padding-end - Select padding end\n * @cssprop --bq-select--paddingY - Select padding top and bottom\n * @cssprop --bq-select--text-color - Select text color\n * @cssprop --bq-select--text-size - Select text size\n * @cssprop --bq-select--text-placeholder-color - Select placeholder text color\n */\n@Component({\n tag: 'bq-select',\n styleUrl: './scss/bq-select.scss',\n formAssociated: true,\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class BqSelect {\n // Own Properties\n // ====================\n\n private helperTextElem?: HTMLElement;\n private inputElem?: HTMLInputElement;\n private labelElem?: HTMLElement;\n private prefixElem?: HTMLElement;\n private suffixElem?: HTMLElement;\n\n private debounceQuery: TDebounce<void>;\n private debounceInput: TDebounce<void>;\n\n private fallbackInputId = 'select';\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqSelectElement;\n @AttachInternals() internals!: ElementInternals;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() displayValue?: string;\n @State() hasHelperText = false;\n @State() selectedOptions: HTMLBqOptionElement[] = [];\n\n @State() hasLabel = false;\n @State() hasPrefix = false;\n @State() hasSuffix = false;\n @State() hasValue = false;\n\n // Public Property API\n // ========================\n\n /** If true, the Select input will be focused on component render */\n @Prop({ reflect: true }) autofocus: boolean;\n\n /** The clear button aria label */\n @Prop({ reflect: true }) clearButtonLabel? = 'Clear value';\n\n /**\n * The amount of time, in milliseconds, to wait before emitting the `bqInput` event after the input value changes.\n * A value of 0 means no debouncing will occur.\n */\n @Prop({ reflect: true, mutable: true }) debounceTime? = 0;\n\n /**\n * Indicates whether the Select input is disabled or not.\n * If `true`, the Select is disabled and cannot be interacted with.\n */\n @Prop({ mutable: true }) disabled?: boolean = false;\n\n /** If true, the clear button won't be displayed */\n @Prop({ reflect: true }) disableClear? = false;\n\n /** Represents the distance (gutter or margin) between the Select panel and the input element. */\n @Prop({ reflect: true }) distance?: number = 8;\n\n /** The ID of the form that the Select input belongs to. */\n @Prop({ reflect: true }) form?: string;\n\n /** If true, the Select panel will remain open after a selection is made. */\n @Prop({ reflect: true }) keepOpenOnSelect?: boolean = false;\n\n /** The Select input name. */\n @Prop({ reflect: true }) name!: string;\n\n /** The maximum number of tags to display when multiple selection is enabled */\n @Prop({ mutable: true }) maxTagsVisible: number = 2;\n\n /** If true, the Select input will allow multiple selections. */\n @Prop({ reflect: true }) multiple?: boolean = false;\n\n /** If true, the Select panel will be visible. */\n @Prop({ reflect: true, mutable: true }) open?: boolean = false;\n\n /** When set, it will override the height of the Select panel. */\n @Prop({ reflect: true }) panelHeight?: string;\n\n /** The Select input placeholder text value */\n @Prop({ reflect: true }) placeholder?: string;\n\n /** Position of the Select panel */\n @Prop({ reflect: true }) placement?: Placement = 'bottom';\n\n /** If true, the list of options cannot be filtered (searching won't be available) */\n @Prop({ reflect: true }) readonly?: boolean;\n\n /** Indicates whether or not the Select input is required to be filled out before submitting the form. */\n @Prop({ reflect: true }) required?: boolean;\n\n /** Whether the panel should have the Select same width as the input element */\n @Prop({ reflect: true }) sameWidth?: boolean = true;\n\n /** Represents the skidding between the Select panel and the input element. */\n @Prop({ reflect: true }) skidding?: number = 0;\n\n /** Defines the strategy to position the Select panel */\n @Prop({ reflect: true }) strategy?: 'fixed' | 'absolute' = 'fixed';\n\n /**\n * The validation status of the Select input.\n *\n * @remarks\n * This property is used to indicate the validation status of the select input. It can be set to one of the following values:\n * - `'none'`: No validation status is set.\n * - `'error'`: The input has a validation error.\n * - `'warning'`: The input has a validation warning.\n * - `'success'`: The input has passed validation.\n */\n @Prop({ reflect: true }) validationStatus: TInputValidation = 'none';\n\n /** The select input value, it can be used to reset the field to a previous value */\n @Prop({ reflect: true, mutable: true }) value: TSelectValue;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('value')\n handleValueChange() {\n // Early return for undefined/null values\n if (isNil(this.value)) {\n this.value = this.multiple ? [] : '';\n this.internals.setFormValue(undefined);\n this.syncItemsFromValue();\n return;\n }\n\n // Handle multiple selection mode\n if (this.multiple) {\n this.value = stringToArray(this.value);\n this.internals.setFormValue(this.value.join(','));\n this.syncItemsFromValue();\n\n return;\n }\n\n // Handle single selection mode\n this.value = String(this.value);\n this.internals.setFormValue(this.value);\n this.syncItemsFromValue();\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Callback handler emitted when the Select input loses focus */\n @Event() bqBlur!: EventEmitter<HTMLBqSelectElement>;\n\n /** Callback handler emitted when the selected value has been cleared */\n @Event() bqClear!: EventEmitter<HTMLBqSelectElement>;\n\n /** Callback handler emitted when the Select input has received focus */\n @Event() bqFocus!: EventEmitter<HTMLBqSelectElement>;\n\n /** Callback handler emitted when the selected value has changed */\n @Event() bqSelect!: EventEmitter<{ value: string | number | string[]; item: HTMLBqOptionElement }>;\n\n /** Callback handler emitted when the Select input changes its value while typing */\n @Event() bqInput: EventEmitter<{ value: string | number | string[] }>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n connectedCallback() {\n this.initMultipleValue();\n }\n\n componentWillLoad() {\n this.initMultipleValue();\n }\n\n componentDidLoad() {\n this.handleSlotChange();\n\n if (this.multiple && Array.isArray(this.value)) {\n this.selectedOptions = this.options.filter((item) => this.value.includes(item.value));\n }\n this.handleValueChange();\n }\n\n formAssociatedCallback() {\n this.internals.role = 'combobox';\n this.internals.ariaExpanded = this.open ? 'true' : 'false';\n }\n\n async formResetCallback() {\n if (isNil(this.value)) return;\n\n this.internals.setValidity({});\n this.clear();\n }\n\n // Listeners\n // ==============\n\n @Listen('bqOpen', { capture: true })\n handleOpenChange(ev: CustomEvent<{ open: boolean }>) {\n if (!ev.composedPath().includes(this.el)) return;\n\n this.open = ev.detail.open;\n }\n\n @Listen('bqFocus', { capture: true })\n @Listen('bqBlur', { capture: true })\n stopOptionFocusBlurPropagation(ev: CustomEvent) {\n // Stop propagation of focus and blur events coming from the `bq-option` elements\n if (isHTMLElement(ev.target, 'bq-select')) return;\n\n ev.stopPropagation();\n }\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n /**\n * Clears the selected value.\n *\n * @return {Promise<void>}\n * @memberof BqSelect\n */\n @Method()\n async clear(): Promise<void> {\n if (this.disabled) return;\n\n const { multiple, inputElem, bqClear, el } = this;\n\n // Clear value and selected options\n this.value = '';\n this.selectedOptions = [];\n\n // Clear display value and input element if not multiple\n if (!multiple) {\n this.displayValue = '';\n inputElem.value = '';\n }\n\n // Update form value and reset options visibility\n this.resetOptionsVisibility();\n\n // Emit clear event\n bqClear.emit(el);\n }\n\n /**\n * Resets the Select input to a previous value.\n *\n * @param {TSelectValue} value - The value to reset the Select input to.\n * @return {Promise<void>}\n * @memberof BqSelect\n */\n @Method()\n async reset(value: TSelectValue): Promise<void> {\n if (isNil(value)) return;\n\n this.value = value;\n this.syncItemsFromValue();\n }\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private initMultipleValue = () => {\n if (!this.multiple) return;\n\n this.value = Array.isArray(this.value) ? this.value : Array.from(JSON.parse(String(this.value)));\n };\n\n private handleBlur = () => {\n if (this.disabled) return;\n\n this.bqBlur.emit(this.el);\n };\n\n private handleFocus = () => {\n if (this.disabled) return;\n\n this.bqFocus.emit(this.el);\n };\n\n private handleSelect = (ev: CustomEvent<{ value: TSelectValue; item: HTMLBqOptionElement }>) => {\n if (this.disabled) return;\n\n if (this.multiple) {\n ev.stopPropagation();\n }\n\n const { value, item } = ev.detail;\n\n if (this.multiple) {\n this.handleMultipleSelection(item);\n // Clear the input value after selecting an item\n this.inputElem.value = '';\n // If multiple selection is enabled, emit the selected items array instead of relying on\n // the option list to emit the value of the selected item\n this.bqSelect.emit({ value: this.value, item });\n } else {\n this.value = value;\n }\n\n this.resetOptionsVisibility();\n this.inputElem.focus();\n };\n\n private handleMultipleSelection = (item: HTMLBqOptionElement) => {\n // Set has O(1) complexity for insertion, deletion, and search operations, compared to an Array's O(n)\n const selectedOptionsSet = new Set(this.selectedOptions);\n\n if (selectedOptionsSet.has(item)) {\n selectedOptionsSet.delete(item);\n } else {\n selectedOptionsSet.add(item);\n }\n\n this.selectedOptions = Array.from(selectedOptionsSet);\n this.value = this.selectedOptions.map((item) => item.value);\n };\n\n private handleSearchFilter = (value: string) => {\n if (this.disabled) return;\n\n this.debounceQuery?.cancel();\n\n if (!isDefined(value)) {\n this.clear();\n } else {\n this.debounceQuery = debounce(() => {\n this.options.forEach((item: HTMLBqOptionElement) => {\n const itemLabel = this.getOptionLabel(item).toLowerCase();\n item.hidden = !itemLabel.includes(value);\n });\n }, this.debounceTime);\n\n this.debounceQuery();\n }\n\n // The panel will close once a selection is made\n // so we need to make sure it's open when the user is typing and the query is not empty\n this.open = true;\n };\n\n private handleInput = (ev: Event) => {\n if (this.disabled) return;\n\n const { value } = ev.target as HTMLInputElement;\n\n this.debounceInput?.cancel();\n\n this.debounceInput = debounce(() => {\n const inputEvent = this.bqInput.emit({ value });\n if (!inputEvent.defaultPrevented) {\n // Continue with search filtering only if the event wasn't prevented\n this.handleSearchFilter(value);\n }\n }, this.debounceTime);\n\n this.debounceInput();\n };\n\n private handleClearClick = (ev: CustomEvent) => {\n (async () => {\n await this.clear();\n })();\n this.inputElem.focus();\n\n ev.stopPropagation();\n };\n\n private handleTagRemove = (item: HTMLBqOptionElement) => {\n if (this.disabled) return;\n\n this.handleMultipleSelection(item);\n this.bqSelect.emit({ value: this.value, item });\n };\n\n private handleSlotChange = () => {\n this.hasLabel = hasSlotContent(this.labelElem);\n this.hasPrefix = hasSlotContent(this.prefixElem);\n this.hasSuffix = hasSlotContent(this.suffixElem);\n this.hasHelperText = hasSlotContent(this.helperTextElem);\n };\n\n private resetOptionsVisibility = () => {\n this.options.forEach((item: HTMLBqOptionElement) => (item.hidden = false));\n };\n\n private syncItemsFromValue = () => {\n const { internals, options, value } = this;\n if (!options.length) return;\n\n // Sync selected state of the BqOption elements\n this.syncSelectedOptionsState();\n\n if (this.multiple) {\n // Sync selected options for multiple selection mode\n this.selectedOptions = options.filter((option) => this.value?.includes(option.value));\n }\n\n // Always update display value and form value\n this.updateDisplayLabel();\n internals.setFormValue(!isNil(value) ? `${value}` : undefined);\n };\n\n /**\n * Syncs the selected state of the BqOption elements which value is included in the `value` property.\n * Notice that value can be a string or an array of strings.\n *\n * @private\n * @memberof BqSelect\n */\n private syncSelectedOptionsState = () => {\n const { options, multiple, value } = this;\n const lowerCaseValue = String(value).toLowerCase();\n\n options.forEach((option: HTMLBqOptionElement) => {\n if (multiple && Array.isArray(value)) {\n option.selected = value.includes(option.value);\n } else {\n option.selected = option.value.toLowerCase() === lowerCaseValue;\n }\n });\n };\n\n /**\n * Updates the display value of the input element based on the selected option.\n *\n * @private\n * @memberof BqSelect\n */\n private updateDisplayLabel = () => {\n const { value, options, inputElem } = this;\n\n const checkedItem = options.find((item) => item.value === value);\n const displayValue = checkedItem ? this.getOptionLabel(checkedItem) : '';\n\n inputElem.value = displayValue;\n this.displayValue = displayValue;\n };\n\n private getOptionLabel = (item: HTMLBqOptionElement) => {\n if (!item) return '';\n return item.innerText.trim() ?? '';\n };\n\n private get options() {\n return Array.from(this.el.querySelectorAll('bq-option'));\n }\n\n private get displayPlaceholder() {\n // Hide the placeholder when multiple selection is enabled and there are selected items\n return this.multiple && this.selectedOptions.length !== 0 ? undefined : this.placeholder;\n }\n\n private get displayTags() {\n return this.selectedOptions.map((item, index) => {\n if (index < this.maxTagsVisible || this.maxTagsVisible < 0) {\n return (\n <bq-tag\n key={item.value}\n removable\n size=\"xsmall\"\n variant=\"filled\"\n onBqClose={(event) => {\n // NOTE: prevents triggering bqClose on parent\n event.stopPropagation();\n this.handleTagRemove(item);\n }}\n // Prevent the tag from closing the panel when clicked\n onClick={(ev: MouseEvent) => ev.stopPropagation()}\n exportparts=\"wrapper:tag__base,prefix:tag__prefix,text:tag__text,btn-close:tag__btn-close\"\n part=\"tag\"\n >\n {this.getOptionLabel(item)}\n </bq-tag>\n );\n } else if (index === this.maxTagsVisible) {\n return (\n <bq-tag\n key=\"more\"\n size=\"xsmall\"\n variant=\"filled\"\n exportparts=\"wrapper:tag__base,prefix:tag__prefix,text:tag__text,btn-close:tag__btn-close\"\n part=\"tag\"\n >\n +{this.selectedOptions.length - index}\n </bq-tag>\n );\n }\n\n return null;\n });\n }\n\n private get hasClearIcon() {\n if (this.disableClear || this.disabled) {\n return false;\n }\n\n if (this.multiple) {\n return this.selectedOptions.length > 0;\n }\n\n return isDefined(this.displayValue);\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const labelId = `bq-select__label-${this.name || this.fallbackInputId}`;\n\n return (\n <div class=\"bq-select\" part=\"base\">\n {/* Label */}\n <label\n id={labelId}\n class={{ 'bq-select__label': true, '!hidden': !this.hasLabel }}\n aria-label={this.name || this.fallbackInputId}\n htmlFor={this.name || this.fallbackInputId}\n ref={(labelElem: HTMLSpanElement) => (this.labelElem = labelElem)}\n part=\"label\"\n >\n <slot name=\"label\" onSlotchange={this.handleSlotChange} />\n </label>\n {/* Select dropdown */}\n <bq-dropdown\n class=\"bq-select__dropdown w-full\"\n disabled={this.disabled}\n distance={this.distance}\n keepOpenOnSelect={this.keepOpenOnSelect}\n open={this.open}\n panelHeight={this.panelHeight}\n placement={this.placement}\n sameWidth={this.sameWidth}\n skidding={this.skidding}\n strategy={this.strategy}\n exportparts=\"panel\"\n >\n {/* Input control group */}\n <div\n class={{\n 'bq-select__control': true,\n [`validation-${this.validationStatus}`]: true,\n disabled: this.disabled,\n }}\n part=\"control\"\n slot=\"trigger\"\n >\n {/* Prefix */}\n <span\n class={{ 'bq-select__control--prefix': true, '!hidden': !this.hasPrefix }}\n ref={(spanElem: HTMLSpanElement) => (this.prefixElem = spanElem)}\n part=\"prefix\"\n >\n <slot name=\"prefix\" onSlotchange={this.handleSlotChange} />\n </span>\n <div class=\"flex flex-1 overflow-x-auto\" part=\"input-outline\">\n {/* Display selected values using BqTags for multiple selection */}\n {this.multiple && (\n <span class=\"bq-select__tags\" part=\"tags\">\n <slot name=\"tags\">{this.displayTags}</slot>\n </span>\n )}\n {/* HTML Input */}\n <input\n id={this.name || this.fallbackInputId}\n class=\"bq-select__control--input flex-grow is-full\"\n autoComplete=\"off\"\n autoCapitalize=\"off\"\n aria-disabled={this.disabled ? 'true' : 'false'}\n aria-controls={`bq-options-${this.name}`}\n aria-expanded={this.open ? 'true' : 'false'}\n aria-haspopup=\"listbox\"\n disabled={this.disabled}\n form={this.form}\n name={this.name}\n placeholder={this.displayPlaceholder}\n ref={(inputElem: HTMLInputElement) => (this.inputElem = inputElem)}\n readOnly={this.readonly}\n required={this.required}\n role=\"combobox\"\n spellcheck={false}\n type=\"text\"\n value={this.displayValue}\n part=\"input\"\n // Events\n onBlur={this.handleBlur}\n onFocus={this.handleFocus}\n onInput={this.handleInput}\n />\n </div>\n {/* Clear Button */}\n {this.hasClearIcon && (\n // The clear button will be visible as long as the input has a value\n // and the parent group is hovered or has focus-within\n <bq-button\n class=\"bq-select__control--clear ms-[--bq-select--gap]\"\n appearance=\"text\"\n aria-label={this.clearButtonLabel}\n size=\"small\"\n onBqClick={this.handleClearClick}\n part=\"clear-btn\"\n exportparts=\"button\"\n tabIndex={-1}\n >\n <slot name=\"clear-icon\">\n <bq-icon name=\"x-circle\" class=\"flex\" />\n </slot>\n </bq-button>\n )}\n {/* Suffix */}\n <span\n class={{ 'bq-select__control--suffix': true, 'rotate-180': this.open, 'rotate-0': !this.open }}\n ref={(spanElem: HTMLSpanElement) => (this.suffixElem = spanElem)}\n part=\"suffix\"\n >\n <slot name=\"suffix\" onSlotchange={this.handleSlotChange}>\n <bq-icon name=\"caret-down\" class=\"flex\" />\n </slot>\n </span>\n </div>\n <bq-option-list\n id={`bq-options-${this.name}`}\n onBqSelect={this.handleSelect}\n aria-expanded={this.open ? 'true' : 'false'}\n exportparts=\"base:option-list\"\n role=\"listbox\"\n >\n <slot />\n </bq-option-list>\n </bq-dropdown>\n {/* Helper text */}\n <div\n class={{\n [`bq-select__helper-text validation-${this.validationStatus}`]: true,\n '!hidden': !this.hasHelperText,\n }}\n ref={(divElem: HTMLDivElement) => (this.helperTextElem = divElem)}\n part=\"helper-text\"\n >\n <slot name=\"helper-text\" onSlotchange={this.handleSlotChange} />\n </div>\n </div>\n );\n }\n}\n"]}
@@ -18,5 +18,6 @@ export * from './isString';
18
18
  export * from './props';
19
19
  export * from './setRafTimeout';
20
20
  export * from './slot';
21
+ export * from './stringToArray';
21
22
  export * from './transition';
22
23
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/beeq/src/shared/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC","sourcesContent":["export * from './assetsPath';\nexport * from './clamp';\nexport * from './cssVariables';\nexport * from './debounce';\nexport * from './event';\nexport * from './getNextElement';\nexport * from './getRandom';\nexport * from './isClient';\nexport * from './isDefined';\nexport * from './isEmpty';\nexport * from './isHTMLElement';\nexport * from './isNil';\nexport * from './isString';\nexport * from './props';\nexport * from './setRafTimeout';\nexport * from './slot';\nexport * from './transition';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/beeq/src/shared/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC","sourcesContent":["export * from './assetsPath';\nexport * from './clamp';\nexport * from './cssVariables';\nexport * from './debounce';\nexport * from './event';\nexport * from './getNextElement';\nexport * from './getRandom';\nexport * from './isClient';\nexport * from './isDefined';\nexport * from './isEmpty';\nexport * from './isHTMLElement';\nexport * from './isNil';\nexport * from './isString';\nexport * from './props';\nexport * from './setRafTimeout';\nexport * from './slot';\nexport * from './stringToArray';\nexport * from './transition';\n"]}
@@ -0,0 +1,24 @@
1
+ /*!
2
+ * Built by Endavans
3
+ * © https://beeq.design - Apache 2 License.
4
+ */
5
+ import { isString } from "./isString";
6
+ /**
7
+ * Converts a string or array to an array.
8
+ *
9
+ * @param {string | string[]} value - The value to convert.
10
+ * @return {string[]} The converted array.
11
+ * @throws {Error} If the input string is not a valid JSON array
12
+ */
13
+ export const stringToArray = (value) => {
14
+ if (isString(value)) {
15
+ try {
16
+ return Array.from(JSON.parse(String(value)));
17
+ }
18
+ catch (error) {
19
+ throw new Error(`Failed to parse string to array. Input must be a valid JSON array string. Details: ${error.message}`);
20
+ }
21
+ }
22
+ return Array.isArray(value) ? value : [];
23
+ };
24
+ //# sourceMappingURL=stringToArray.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stringToArray.js","sourceRoot":"","sources":["../../../../../../packages/beeq/src/shared/utils/stringToArray.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAwB,EAAY,EAAE;IAClE,IAAI,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACpB,IAAI,CAAC;YACH,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC/C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CACb,sFAAsF,KAAK,CAAC,OAAO,EAAE,CACtG,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AAC3C,CAAC,CAAC","sourcesContent":["import { isString } from './isString';\n\n/**\n * Converts a string or array to an array.\n *\n * @param {string | string[]} value - The value to convert.\n * @return {string[]} The converted array.\n * @throws {Error} If the input string is not a valid JSON array\n */\nexport const stringToArray = (value: string | string[]): string[] => {\n if (isString(value)) {\n try {\n return Array.from(JSON.parse(String(value)));\n } catch (error) {\n throw new Error(\n `Failed to parse string to array. Input must be a valid JSON array string. Details: ${error.message}`,\n );\n }\n }\n return Array.isArray(value) ? value : [];\n};\n"]}