@shoper/phoenix_design_system 1.8.0-2 → 1.8.0-3
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.
- package/build/cjs/packages/phoenix/src/components/form/select/model/select_option_mapper.js +1 -1
- package/build/cjs/packages/phoenix/src/components/form/select/select.js +3 -3
- package/build/esm/packages/phoenix/src/components/form/select/model/select_option_mapper.js +1 -1
- package/build/esm/packages/phoenix/src/components/form/select/select.js +3 -3
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ class SelectOptionMapper {
|
|
|
9
9
|
static toModel($option) {
|
|
10
10
|
var _a;
|
|
11
11
|
const optionContent = (_a = $option.querySelector(select_components_constatns.SELECT_RELATED_COMPONENTS_NAMES.optionContent)) === null || _a === void 0 ? void 0 : _a.textContent;
|
|
12
|
-
const value = $option.
|
|
12
|
+
const value = $option.value;
|
|
13
13
|
if (!value)
|
|
14
14
|
throw new Error('h-option must contain a unique value');
|
|
15
15
|
if (!optionContent)
|
|
@@ -186,7 +186,7 @@ exports.HSelect = class HSelect extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
186
186
|
this._optionsObserver = new observer.Observer((selectedOptions) => this._updateOptionsView(selectedOptions));
|
|
187
187
|
this._selectController.options$.subscribe(this._optionsObserver);
|
|
188
188
|
this._$options = $options.reduce((acc, $option) => {
|
|
189
|
-
const value = $option.
|
|
189
|
+
const value = $option.value;
|
|
190
190
|
if (!value)
|
|
191
191
|
throw Error('Select option must hava a value');
|
|
192
192
|
if (acc[value] !== undefined)
|
|
@@ -318,11 +318,11 @@ exports.HSelect = class HSelect extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
318
318
|
>
|
|
319
319
|
${this.getSlot(select_constants.SELECT_SLOT_NAMES.content)}
|
|
320
320
|
|
|
321
|
-
${repeat.repeat(this.optionsList, (option) => option.value, (option) => {
|
|
321
|
+
${this.optionsList ? repeat.repeat(this.optionsList, (option) => option.value, (option) => {
|
|
322
322
|
return lit.html ` <h-option value=${option.value}>
|
|
323
323
|
<h-option-content>${option.content}</h-option-content>
|
|
324
324
|
</h-option>`;
|
|
325
|
-
})}
|
|
325
|
+
}) : lit.nothing}
|
|
326
326
|
</h-options>
|
|
327
327
|
|
|
328
328
|
${this._searchNoResult()
|
|
@@ -5,7 +5,7 @@ class SelectOptionMapper {
|
|
|
5
5
|
static toModel($option) {
|
|
6
6
|
var _a;
|
|
7
7
|
const optionContent = (_a = $option.querySelector(SELECT_RELATED_COMPONENTS_NAMES.optionContent)) === null || _a === void 0 ? void 0 : _a.textContent;
|
|
8
|
-
const value = $option.
|
|
8
|
+
const value = $option.value;
|
|
9
9
|
if (!value)
|
|
10
10
|
throw new Error('h-option must contain a unique value');
|
|
11
11
|
if (!optionContent)
|
|
@@ -182,7 +182,7 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
182
182
|
this._optionsObserver = new Observer((selectedOptions) => this._updateOptionsView(selectedOptions));
|
|
183
183
|
this._selectController.options$.subscribe(this._optionsObserver);
|
|
184
184
|
this._$options = $options.reduce((acc, $option) => {
|
|
185
|
-
const value = $option.
|
|
185
|
+
const value = $option.value;
|
|
186
186
|
if (!value)
|
|
187
187
|
throw Error('Select option must hava a value');
|
|
188
188
|
if (acc[value] !== undefined)
|
|
@@ -314,11 +314,11 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
314
314
|
>
|
|
315
315
|
${this.getSlot(SELECT_SLOT_NAMES.content)}
|
|
316
316
|
|
|
317
|
-
${repeat(this.optionsList, (option) => option.value, (option) => {
|
|
317
|
+
${this.optionsList ? repeat(this.optionsList, (option) => option.value, (option) => {
|
|
318
318
|
return html ` <h-option value=${option.value}>
|
|
319
319
|
<h-option-content>${option.content}</h-option-content>
|
|
320
320
|
</h-option>`;
|
|
321
|
-
})}
|
|
321
|
+
}) : nothing}
|
|
322
322
|
</h-options>
|
|
323
323
|
|
|
324
324
|
${this._searchNoResult()
|