@shoper/phoenix_design_system 1.5.4 → 1.5.5
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.
|
@@ -101,11 +101,7 @@ exports.HSelect = class HSelect extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
101
101
|
this._handleResize = debounce['default'](() => {
|
|
102
102
|
this._closeSelect();
|
|
103
103
|
}, select_constants.SELECT_RESIZE_DEBOUNCE_TIME);
|
|
104
|
-
const $options = this.
|
|
105
|
-
? this.getSlot('content')
|
|
106
|
-
.map((litElement) => litElement.values[0])
|
|
107
|
-
.filter((element) => element instanceof select_option.HOption)
|
|
108
|
-
: Array.from(this.querySelectorAll(select_components_constatns.SELECT_RELATED_COMPONENTS_NAMES.option));
|
|
104
|
+
const $options = Array.from(this.querySelectorAll(select_components_constatns.SELECT_RELATED_COMPONENTS_NAMES.option));
|
|
109
105
|
$options.forEach(($option) => $option.setAttribute('slot', select_constants.SELECT_SLOT_NAMES.content));
|
|
110
106
|
this.$placeholder = (_a = this.querySelector(`[slot="${select_components_constatns.SELECT_INPUT_PLACEHOLDER_SLOT_NAME}"]`)) !== null && _a !== void 0 ? _a : 'Select';
|
|
111
107
|
if (this.multiple)
|
|
@@ -167,7 +163,11 @@ exports.HSelect = class HSelect extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
167
163
|
this._selectController = this.multiple ? new multi_select_controller.MultiSelectController({ host: this }) : new select_controller.SelectController({ host: this });
|
|
168
164
|
this._selectContext.provide(select_constants.SELECT_CONTEXTS.selectedOptions$, this._selectController.selectedOptions$);
|
|
169
165
|
this._selectContext.provide(select_constants.SELECT_CONTEXTS.isMultiselect, this.multiple);
|
|
170
|
-
const $options =
|
|
166
|
+
const $options = this.hasSlot('content')
|
|
167
|
+
? this.getSlot('content')
|
|
168
|
+
.map((litElement) => litElement.values[0])
|
|
169
|
+
.filter((element) => element instanceof select_option.HOption)
|
|
170
|
+
: Array.from(this.querySelectorAll(select_components_constatns.SELECT_RELATED_COMPONENTS_NAMES.option));
|
|
171
171
|
this._optionsObserver = new observer.Observer((selectedOptions) => this._updateOptionsView(selectedOptions));
|
|
172
172
|
this._selectController.options$.subscribe(this._optionsObserver);
|
|
173
173
|
this._$options = $options.reduce((acc, $option) => {
|
|
@@ -97,11 +97,7 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
97
97
|
this._handleResize = debounce_1(() => {
|
|
98
98
|
this._closeSelect();
|
|
99
99
|
}, SELECT_RESIZE_DEBOUNCE_TIME);
|
|
100
|
-
const $options = this.
|
|
101
|
-
? this.getSlot('content')
|
|
102
|
-
.map((litElement) => litElement.values[0])
|
|
103
|
-
.filter((element) => element instanceof HOption)
|
|
104
|
-
: Array.from(this.querySelectorAll(SELECT_RELATED_COMPONENTS_NAMES.option));
|
|
100
|
+
const $options = Array.from(this.querySelectorAll(SELECT_RELATED_COMPONENTS_NAMES.option));
|
|
105
101
|
$options.forEach(($option) => $option.setAttribute('slot', SELECT_SLOT_NAMES.content));
|
|
106
102
|
this.$placeholder = (_a = this.querySelector(`[slot="${SELECT_INPUT_PLACEHOLDER_SLOT_NAME}"]`)) !== null && _a !== void 0 ? _a : 'Select';
|
|
107
103
|
if (this.multiple)
|
|
@@ -163,7 +159,11 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
163
159
|
this._selectController = this.multiple ? new MultiSelectController({ host: this }) : new SelectController({ host: this });
|
|
164
160
|
this._selectContext.provide(SELECT_CONTEXTS.selectedOptions$, this._selectController.selectedOptions$);
|
|
165
161
|
this._selectContext.provide(SELECT_CONTEXTS.isMultiselect, this.multiple);
|
|
166
|
-
const $options =
|
|
162
|
+
const $options = this.hasSlot('content')
|
|
163
|
+
? this.getSlot('content')
|
|
164
|
+
.map((litElement) => litElement.values[0])
|
|
165
|
+
.filter((element) => element instanceof HOption)
|
|
166
|
+
: Array.from(this.querySelectorAll(SELECT_RELATED_COMPONENTS_NAMES.option));
|
|
167
167
|
this._optionsObserver = new Observer((selectedOptions) => this._updateOptionsView(selectedOptions));
|
|
168
168
|
this._selectController.options$.subscribe(this._optionsObserver);
|
|
169
169
|
this._$options = $options.reduce((acc, $option) => {
|