@infineon/infineon-design-system-stencil 30.6.1 → 30.6.2--canary.1658.4e0299382cc78146674b539e7aec5baa0c8f1d1c.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.
@@ -6838,6 +6838,7 @@ const Choices = class {
6838
6838
  registerInstance(this, hostRef);
6839
6839
  this.ifxSelect = createEvent(this, "ifxSelect", 7);
6840
6840
  this.ifxInput = createEvent(this, "ifxInput", 7);
6841
+ this.previousOptions = [];
6841
6842
  this.value = undefined;
6842
6843
  this.name = undefined;
6843
6844
  this.items = undefined;
@@ -7042,7 +7043,14 @@ const Choices = class {
7042
7043
  }
7043
7044
  componentWillUpdate() {
7044
7045
  this.handleCloseButton();
7045
- this.clearSelectField();
7046
+ this.previousOptions = [...this.options];
7047
+ const optionsAreEqual = this.isEqual(this.options, this.previousOptions);
7048
+ if (this.options && !optionsAreEqual) {
7049
+ this.clearSelectField();
7050
+ }
7051
+ }
7052
+ isEqual(a, b) {
7053
+ return JSON.stringify(a) === JSON.stringify(b);
7046
7054
  }
7047
7055
  addResizeObserver() {
7048
7056
  this.resizeObserver = new ResizeObserver(() => {
@@ -7078,9 +7086,9 @@ const Choices = class {
7078
7086
  // destroy choices element to restore previous dom structure
7079
7087
  // so vdom can replace the element correctly
7080
7088
  this.destroy();
7081
- return (h("div", { key: '0b80fbf12bc170ffd8d683244254c1203b7cff00', class: `ifx-select-container` }, this.label ? (h("div", { class: "ifx-label-wrapper" }, h("span", null, this.label))) : null, h("div", { key: '22c0014b84cb785547ca9f8ebf7ec4ea97aff799', class: `${choicesWrapperClass}
7089
+ return (h("div", { key: 'c56d2b70ff9f812bcbb40021321a40903a14b5a5', class: `ifx-select-container` }, this.label ? (h("div", { class: "ifx-label-wrapper" }, h("span", null, this.label))) : null, h("div", { key: 'a0812c653fdc3da7d81148750f628351a9cf080d', class: `${choicesWrapperClass}
7082
7090
  ${this.disabled ? 'disabled' : ''}
7083
- ${this.error ? 'error' : ''}`, onClick: this.disabled ? undefined : () => this.toggleDropdown(), onKeyDown: event => this.handleKeyDown(event) }, h("select", Object.assign({ key: 'a622c7cf6ee90850ba1d640d1e600f26447b92ef', class: 'single__select-input-field', disabled: this.disabled }, attributes, { "data-trigger": true, onChange: () => this.handleChange() }), this.createSelectOptions(this.options)), h("div", { key: 'e6ce74bacf6aae8d8e6b4f7cb688ae480721ea42', class: "single__select-icon-container" }, this.optionIsSelected && (h("div", { key: '05c1838e33693050debb5ed83b2c95f4d9d958e3', class: "ifx-choices__icon-wrapper-delete" }, h("ifx-icon", { key: 'b490d8eca9861f636c5b478974d6df6d5a3ab19d', icon: "cremove16", onClick: () => this.handleDeleteSelection() }))), h("div", { key: '926b34f8f945fff2a9eaeea7ef5c8ef7dba976b4', class: "ifx-choices__icon-wrapper-up" }, h("ifx-icon", { key: "icon-up", icon: "chevronup-16" })), h("div", { key: 'cd4eadb735c2a3b49c80e5a77aa87b943998ee95', 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));
7091
+ ${this.error ? 'error' : ''}`, onClick: this.disabled ? undefined : () => this.toggleDropdown(), onKeyDown: event => this.handleKeyDown(event) }, h("select", Object.assign({ key: '8e96c14d91b774990a6d026aaa8b529026132a4c', class: 'single__select-input-field', disabled: this.disabled }, attributes, { "data-trigger": true, onChange: () => this.handleChange() }), this.createSelectOptions(this.options)), h("div", { key: 'e52d7c8f81cb119380500ff292c650f3e6306d2d', class: "single__select-icon-container" }, this.optionIsSelected && (h("div", { key: 'f9b82119789bd12895ca3699a52d8a58e75a4d33', class: "ifx-choices__icon-wrapper-delete" }, h("ifx-icon", { key: '6cf31bdd364f622301e12f2b7f925ab6a5a4a498', icon: "cremove16", onClick: () => this.handleDeleteSelection() }))), h("div", { key: '0b209301e4ec81c00cc391009eaf60b3b5277210', class: "ifx-choices__icon-wrapper-up" }, h("ifx-icon", { key: "icon-up", icon: "chevronup-16" })), h("div", { key: 'e0a59a35741d947717d523a0b48a01d712d13049', 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));
7084
7092
  }
7085
7093
  toggleDropdown() {
7086
7094
  const div = this.root.querySelector('.ifx-choices__wrapper');