@infineon/infineon-design-system-stencil 32.2.0 → 32.3.0--canary.1735.caab07de0687d0c12e1cd3ff61f282de3445523b.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.
@@ -7034,6 +7034,15 @@ const Choices = class {
7034
7034
  this.resizeObserver = null;
7035
7035
  }
7036
7036
  }
7037
+ handleWrapperClick(event) {
7038
+ const target = event.target;
7039
+ const isSearchInput = target.classList.contains('choices__input') || target.closest('.choices__input');
7040
+ const isDropdownItem = target.closest('.choices__list--dropdown .choices__item');
7041
+ // Only toggle dropdown if clicking on wrapper itself
7042
+ if (!isSearchInput && !isDropdownItem) {
7043
+ this.toggleDropdown();
7044
+ }
7045
+ }
7037
7046
  render() {
7038
7047
  const attributes = {
7039
7048
  'data-selector': 'root',
@@ -7044,9 +7053,9 @@ const Choices = class {
7044
7053
  // destroy choices element to restore previous dom structure
7045
7054
  // so vdom can replace the element correctly
7046
7055
  this.destroy();
7047
- return (h("div", { key: 'fea26b0d75050a64b85be4a9d60c5353e64c28a6', class: `ifx-select-container` }, this.label ? (h("div", { class: "ifx-label-wrapper" }, h("span", null, this.label))) : null, h("div", { key: '122cdbeb12cd1c268a274971a0d0619d95fcc0a2', class: `${choicesWrapperClass}
7056
+ return (h("div", { key: '21623bb2329c6fbe07fdaf7a13ed1c7ced0f76c6', class: `ifx-select-container` }, this.label ? (h("div", { class: "ifx-label-wrapper" }, h("span", null, this.label))) : null, h("div", { key: '733439a9d0fc293e2338423cc4dfd2b2f4596fd4', class: `${choicesWrapperClass}
7048
7057
  ${this.disabled ? 'disabled' : ''}
7049
- ${this.error ? 'error' : ''}`, onClick: this.disabled ? undefined : () => this.toggleDropdown(), onKeyDown: event => this.handleKeyDown(event) }, h("select", Object.assign({ key: 'c138c46ae14722f0629b89649824a6414e19fcaf', class: 'single__select-input-field', disabled: this.disabled }, attributes, { "data-trigger": true, onChange: () => this.handleChange() }), this.createSelectOptions(this.options)), h("div", { key: '3999f9e02015fecc4758b269c43d2f0c3ba2ba69', class: "single__select-icon-container" }, this.optionIsSelected && (h("div", { key: 'd91f27712ff0febb0a6186b0dec1f41eff67c5d4', class: "ifx-choices__icon-wrapper-delete" }, h("ifx-icon", { key: '580986c3a71f9210c1a48caa6ee5f02d46531aa3', icon: "cremove16", onClick: () => this.handleDeleteSelection() }))), h("div", { key: '002e77d28f1e5c75c7e6df46680120a7e7061727', class: "ifx-choices__icon-wrapper-up" }, h("ifx-icon", { key: "icon-up", icon: "chevronup-16" })), h("div", { key: '0cf642c93a5daed04a01e7229573c06c45ab843d', class: "ifx-choices__icon-wrapper-down" }, h("ifx-icon", { key: "icon-down", icon: "chevron-down-16" })))), this.error ? (h("div", { class: "ifx-error-message-wrapper" }, h("span", null, this.errorMessage))) : null));
7058
+ ${this.error ? 'error' : ''}`, onClick: this.disabled ? undefined : (e) => this.handleWrapperClick(e), onKeyDown: event => this.handleKeyDown(event) }, h("select", Object.assign({ key: '781e8a7567c660c5e896f32be84a3704ea34f43a', class: 'single__select-input-field', disabled: this.disabled }, attributes, { "data-trigger": true, onChange: () => this.handleChange() }), this.createSelectOptions(this.options)), h("div", { key: 'c7600e164145027a85ff2e4370825868b5290229', class: "single__select-icon-container" }, this.optionIsSelected && (h("div", { key: '5ebb1b1f69c7879ace354e63c814063c5ea4c6e5', class: "ifx-choices__icon-wrapper-delete" }, h("ifx-icon", { key: 'ce160e99cdf0bcf02a005d4ec8287a7f47cf9dcd', icon: "cremove16", onClick: () => this.handleDeleteSelection() }))), h("div", { key: 'f1ff0fde3fe57b61b90d19b835011338bfe62ea1', class: "ifx-choices__icon-wrapper-up" }, h("ifx-icon", { key: "icon-up", icon: "chevronup-16" })), h("div", { key: '2e1fa631b36b6fd12ce01a1b8f798b820f0b2c90', class: "ifx-choices__icon-wrapper-down" }, h("ifx-icon", { key: "icon-down", icon: "chevron-down-16" })))), this.error ? (h("div", { class: "ifx-error-message-wrapper" }, h("span", null, this.errorMessage))) : null));
7050
7059
  }
7051
7060
  toggleDropdown() {
7052
7061
  const div = this.root.querySelector('.ifx-choices__wrapper');