@shoper/phoenix_design_system 1.18.8-9 → 1.18.9

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 (54) hide show
  1. package/build/cjs/packages/phoenix/src/components/form/select/model/select_option.js +2 -1
  2. package/build/cjs/packages/phoenix/src/components/form/select/model/select_option.js.map +1 -1
  3. package/build/cjs/packages/phoenix/src/components/form/select/model/select_option_mapper.js +3 -2
  4. package/build/cjs/packages/phoenix/src/components/form/select/model/select_option_mapper.js.map +1 -1
  5. package/build/cjs/packages/phoenix/src/components/form/select/select.js +85 -13
  6. package/build/cjs/packages/phoenix/src/components/form/select/select.js.map +1 -1
  7. package/build/cjs/packages/phoenix/src/components/form/select/select_utils.js +22 -2
  8. package/build/cjs/packages/phoenix/src/components/form/select/select_utils.js.map +1 -1
  9. package/build/cjs/packages/phoenix/src/index.js +2 -32
  10. package/build/cjs/packages/phoenix/src/index.js.map +1 -1
  11. package/build/esm/packages/phoenix/src/components/form/select/model/select_option.d.ts +1 -0
  12. package/build/esm/packages/phoenix/src/components/form/select/model/select_option.js +2 -1
  13. package/build/esm/packages/phoenix/src/components/form/select/model/select_option.js.map +1 -1
  14. package/build/esm/packages/phoenix/src/components/form/select/model/select_option_mapper.js +3 -2
  15. package/build/esm/packages/phoenix/src/components/form/select/model/select_option_mapper.js.map +1 -1
  16. package/build/esm/packages/phoenix/src/components/form/select/model/select_option_types.d.ts +1 -0
  17. package/build/esm/packages/phoenix/src/components/form/select/select.d.ts +5 -0
  18. package/build/esm/packages/phoenix/src/components/form/select/select.js +85 -13
  19. package/build/esm/packages/phoenix/src/components/form/select/select.js.map +1 -1
  20. package/build/esm/packages/phoenix/src/components/form/select/select_utils.d.ts +1 -0
  21. package/build/esm/packages/phoenix/src/components/form/select/select_utils.js +22 -2
  22. package/build/esm/packages/phoenix/src/components/form/select/select_utils.js.map +1 -1
  23. package/build/esm/packages/phoenix/src/index.d.ts +1 -5
  24. package/build/esm/packages/phoenix/src/index.js +1 -5
  25. package/build/esm/packages/phoenix/src/index.js.map +1 -1
  26. package/package.json +2 -2
  27. package/build/cjs/packages/phoenix/src/components/details/details.js +0 -33
  28. package/build/cjs/packages/phoenix/src/components/details/details.js.map +0 -1
  29. package/build/cjs/packages/phoenix/src/components/details/details_constants.js +0 -20
  30. package/build/cjs/packages/phoenix/src/components/details/details_constants.js.map +0 -1
  31. package/build/cjs/packages/phoenix/src/components/details/details_content.js +0 -23
  32. package/build/cjs/packages/phoenix/src/components/details/details_content.js.map +0 -1
  33. package/build/cjs/packages/phoenix/src/components/details/details_group.js +0 -125
  34. package/build/cjs/packages/phoenix/src/components/details/details_group.js.map +0 -1
  35. package/build/cjs/packages/phoenix/src/components/details/details_toggler.js +0 -19
  36. package/build/cjs/packages/phoenix/src/components/details/details_toggler.js.map +0 -1
  37. package/build/esm/packages/phoenix/src/components/details/details.d.ts +0 -8
  38. package/build/esm/packages/phoenix/src/components/details/details.js +0 -31
  39. package/build/esm/packages/phoenix/src/components/details/details.js.map +0 -1
  40. package/build/esm/packages/phoenix/src/components/details/details_constants.d.ts +0 -11
  41. package/build/esm/packages/phoenix/src/components/details/details_constants.js +0 -14
  42. package/build/esm/packages/phoenix/src/components/details/details_constants.js.map +0 -1
  43. package/build/esm/packages/phoenix/src/components/details/details_content.d.ts +0 -6
  44. package/build/esm/packages/phoenix/src/components/details/details_content.js +0 -21
  45. package/build/esm/packages/phoenix/src/components/details/details_content.js.map +0 -1
  46. package/build/esm/packages/phoenix/src/components/details/details_group.d.ts +0 -18
  47. package/build/esm/packages/phoenix/src/components/details/details_group.js +0 -123
  48. package/build/esm/packages/phoenix/src/components/details/details_group.js.map +0 -1
  49. package/build/esm/packages/phoenix/src/components/details/details_toggler.d.ts +0 -5
  50. package/build/esm/packages/phoenix/src/components/details/details_toggler.js +0 -17
  51. package/build/esm/packages/phoenix/src/components/details/details_toggler.js.map +0 -1
  52. package/build/esm/packages/phoenix/src/components/details/details_types.d.ts +0 -12
  53. package/build/esm/packages/phoenix/src/components/details/details_types.js +0 -2
  54. package/build/esm/packages/phoenix/src/components/details/details_types.js.map +0 -1
@@ -39,6 +39,7 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
39
39
  this.type = SELECT_TYPES.select;
40
40
  this.noDeselect = false;
41
41
  this.assistiveTitleId = '';
42
+ this.isDevSelectPlaceholderFlagEnabled = false;
42
43
  this.translations = {};
43
44
  this._selectOptionsId = v4();
44
45
  this._searchValue = '';
@@ -53,7 +54,7 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
53
54
  const $options = this._getOptions();
54
55
  this._$options = $options.reduce((acc, $option) => {
55
56
  const value = $option.getAttribute('value');
56
- if (!value)
57
+ if (value === null || value === undefined)
57
58
  throw Error('Select option must hava a value');
58
59
  if (acc.has(value))
59
60
  throw Error('Select options must hava a unique values.');
@@ -110,12 +111,24 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
110
111
  if (!this.$searchLabel)
111
112
  return;
112
113
  (_a = this.$searchLabel.querySelector(`[id="value-label"]`)) === null || _a === void 0 ? void 0 : _a.remove();
113
- this.$searchLabel.innerHTML = `
114
- ${(_b = this.$searchLabel) === null || _b === void 0 ? void 0 : _b.innerHTML}
115
- <span id="value-label" class="sr-only">
116
- ${options.reduce((totalSelectedContent, currentOption) => (totalSelectedContent += currentOption.content), '')}
117
- </span>
118
- `;
114
+ if (this.isDevSelectPlaceholderFlagEnabled) {
115
+ const hasValidOptions = options.some((option) => !option.isPlaceholder);
116
+ if (!hasValidOptions)
117
+ return;
118
+ const valueLabelSpan = document.createElement('span');
119
+ valueLabelSpan.id = 'value-label';
120
+ valueLabelSpan.className = 'sr-only';
121
+ valueLabelSpan.textContent = options.reduce((totalSelectedContent, currentOption) => totalSelectedContent + currentOption.content, '');
122
+ this.$searchLabel.appendChild(valueLabelSpan);
123
+ }
124
+ else {
125
+ this.$searchLabel.innerHTML = `
126
+ ${(_b = this.$searchLabel) === null || _b === void 0 ? void 0 : _b.innerHTML}
127
+ <span id="value-label" class="sr-only">
128
+ ${options.reduce((totalSelectedContent, currentOption) => (totalSelectedContent += currentOption.content), '')}
129
+ </span>
130
+ `;
131
+ }
119
132
  };
120
133
  this._handleOptionClicked = ({ detail }) => {
121
134
  if (!(detail === null || detail === void 0 ? void 0 : detail.$option))
@@ -213,6 +226,9 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
213
226
  }
214
227
  if (changedProperties.has('optionsList')) {
215
228
  this._updateOptions();
229
+ if (this.isDevSelectPlaceholderFlagEnabled) {
230
+ this._addPlaceholderOptionIfNeeded();
231
+ }
216
232
  }
217
233
  if (this._$optionsList.value) {
218
234
  (_a = this.listBoxController) === null || _a === void 0 ? void 0 : _a.hostDisconnected();
@@ -261,6 +277,9 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
261
277
  this._selectedOptionsAriaObserver = new Observer((selectedOptions) => this._updateLabelAria(selectedOptions));
262
278
  this._selectController.selectedOptions$.subscribe(this._selectedOptionsAriaObserver);
263
279
  this._updateOptions();
280
+ if (this.isDevSelectPlaceholderFlagEnabled) {
281
+ this._addPlaceholderOptionIfNeeded();
282
+ }
264
283
  this._setupEvents();
265
284
  }
266
285
  attributeChangedCallback(name, _old, value) {
@@ -273,6 +292,50 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
273
292
  this.disabled ? this.classList.add(SELECT_CSS_CLASSES.selectDisabled) : this.classList.remove(SELECT_CSS_CLASSES.selectDisabled);
274
293
  }
275
294
  }
295
+ _addPlaceholderOptionIfNeeded() {
296
+ if (!this._canAddPlaceholder)
297
+ return;
298
+ const $placeholderOption = this._createPlaceholderOption();
299
+ this._injectOptionIntoDOM($placeholderOption);
300
+ this._updateOptions();
301
+ }
302
+ get _canAddPlaceholder() {
303
+ var _a;
304
+ if (this.multiple || this.required)
305
+ return false;
306
+ const hasSelection = (((_a = this._selectController.selectedOptions$.getValue()) === null || _a === void 0 ? void 0 : _a.length) || 0) > 0;
307
+ if (hasSelection)
308
+ return false;
309
+ const hasExistingPlaceholder = !!this.querySelector('h-option[placeholder]');
310
+ return !hasExistingPlaceholder;
311
+ }
312
+ _createPlaceholderOption() {
313
+ const $option = document.createElement('h-option');
314
+ $option.setAttribute('value', '');
315
+ $option.setAttribute('selected', 'true');
316
+ $option.setAttribute('placeholder', 'true');
317
+ $option.setAttribute('slot', SELECT_SLOT_NAMES.content);
318
+ const $content = document.createElement(SELECT_RELATED_COMPONENTS_NAMES.optionContent);
319
+ if (typeof this.$placeholder === 'string') {
320
+ $content.textContent = this.$placeholder;
321
+ }
322
+ else if (this.$placeholder instanceof Node) {
323
+ Array.from(this.$placeholder.childNodes).forEach(node => {
324
+ $content.appendChild(node.cloneNode(true));
325
+ });
326
+ }
327
+ $option.appendChild($content);
328
+ return $option;
329
+ }
330
+ _injectOptionIntoDOM($option) {
331
+ const $firstOption = this.querySelector(SELECT_RELATED_COMPONENTS_NAMES.option);
332
+ if ($firstOption) {
333
+ this.insertBefore($option, $firstOption);
334
+ }
335
+ else {
336
+ this.appendChild($option);
337
+ }
338
+ }
276
339
  _setupEvents() {
277
340
  this.addEventListener(SELECT_EVENT_NAMES.deselectOption, this._handleOptionDeselect);
278
341
  this.addEventListener(SELECT_CLOSE_BTN_EVENT_NAMES.close, this._closeSelect);
@@ -353,7 +416,7 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
353
416
  return fragment;
354
417
  }
355
418
  render() {
356
- var _a, _b, _c, _d, _e;
419
+ var _a, _b, _c, _d, _e, _f;
357
420
  const options = (_a = this._selectController.options$.getValue()) !== null && _a !== void 0 ? _a : [];
358
421
  const isSearchEnabled = !this.searchDisabled && options.length > MIN_NUMBER_OF_OPTIONS_TO_SHOW_SEARCH;
359
422
  return html `
@@ -377,6 +440,7 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
377
440
  aria-activedescendant
378
441
  role="combobox"
379
442
  aria-controls="${this._selectOptionsId}"
443
+ aria-labelledby="${this.assistiveTitleId}"
380
444
  >
381
445
  ${this.getSlot(SELECT_SLOT_NAMES.toggler)}
382
446
  </h-dropdown-toggler>
@@ -389,14 +453,18 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
389
453
  >
390
454
  <h-select-close-btn class="${SELECT_CSS_CLASSES.selectCloseMobileButton}" @close=${this._closeSelect}></h-select-close-btn>
391
455
 
392
- <div class=${SELECT_CSS_CLASSES.selectLabel}>${html `${this._getClonedPlaceholderElement()}`}</div>
456
+ <div class=${SELECT_CSS_CLASSES.selectLabel}>
457
+ ${this.isDevSelectPlaceholderFlagEnabled ?
458
+ (_b = this.$searchLabel) === null || _b === void 0 ? void 0 : _b.cloneNode(true) :
459
+ html `${this._getClonedPlaceholderElement()}`}
460
+ </div>
393
461
 
394
462
  ${isSearchEnabled
395
463
  ? html ` <h-select-search
396
464
  class=${SELECT_CSS_CLASSES.selectSearch}
397
465
  ${ref(this.$search)}
398
466
  .value=${this._searchValue}
399
- placeholder=${((_b = this.translations) === null || _b === void 0 ? void 0 : _b.search) || SELECT_DEFAULT_TRANSLATIONS.SEARCH}
467
+ placeholder=${((_c = this.translations) === null || _c === void 0 ? void 0 : _c.search) || SELECT_DEFAULT_TRANSLATIONS.SEARCH}
400
468
  @search=${this._handleSearch}
401
469
  ></h-select-search>`
402
470
  : nothing}
@@ -417,7 +485,7 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
417
485
  ${this._searchNoResult()
418
486
  ? html ` <div>
419
487
  <p class=${SELECT_CSS_CLASSES.selectNoResult}>
420
- ${((_c = this.translations) === null || _c === void 0 ? void 0 : _c.noResultsFor) || SELECT_DEFAULT_TRANSLATIONS.NO_RESULTS_FOR}:
488
+ ${((_d = this.translations) === null || _d === void 0 ? void 0 : _d.noResultsFor) || SELECT_DEFAULT_TRANSLATIONS.NO_RESULTS_FOR}:
421
489
  <em class=${SELECT_CSS_CLASSES.selectSearchedPhrase}>"${this._searchValue}"</em>
422
490
  </p>
423
491
  </div>`
@@ -426,11 +494,11 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
426
494
  ? html `
427
495
  <section class=${SELECT_CSS_CLASSES.selectFooter}>
428
496
  <button class="${SELECT_CSS_CLASSES.selectClearButton}" @click=${this._clearOptions}>
429
- ${((_d = this.translations) === null || _d === void 0 ? void 0 : _d.reset) || SELECT_DEFAULT_TRANSLATIONS.RESET}
497
+ ${((_e = this.translations) === null || _e === void 0 ? void 0 : _e.reset) || SELECT_DEFAULT_TRANSLATIONS.RESET}
430
498
  </button>
431
499
  <h-select-close-btn class="${SELECT_CSS_CLASSES.selectCloseButton}" @close=${this._closeSelect}
432
500
  ><span slot=${SELECT_CLOSE_BUTTON_CONTENT_SLOT_NAME}
433
- >${((_e = this.translations) === null || _e === void 0 ? void 0 : _e.choose) || SELECT_DEFAULT_TRANSLATIONS.CHOOSE}</span
501
+ >${((_f = this.translations) === null || _f === void 0 ? void 0 : _f.choose) || SELECT_DEFAULT_TRANSLATIONS.CHOOSE}</span
434
502
  >
435
503
  </h-select-close-btn>
436
504
  </section>
@@ -504,6 +572,10 @@ __decorate([
504
572
  property({ type: String, attribute: 'assistive-title-id' }),
505
573
  __metadata("design:type", String)
506
574
  ], HSelect.prototype, "assistiveTitleId", void 0);
575
+ __decorate([
576
+ property({ type: Boolean, attribute: 'is-dev-select-placeholder-flag-enabled' }),
577
+ __metadata("design:type", Boolean)
578
+ ], HSelect.prototype, "isDevSelectPlaceholderFlagEnabled", void 0);
507
579
  __decorate([
508
580
  property({
509
581
  converter: {
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,+CAAmD;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,wDAA4D;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,+CAAmD;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,wDAA4D;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -8,4 +8,5 @@ export declare class SelectControlUtils {
8
8
  static appendHTMLOption($option: HOption, $list: HOptions, position?: number): void;
9
9
  static getFirstIndexSelectedOption(options: HOption[]): number;
10
10
  static getLastIndexOfSelectedOption(options: HOption[]): number;
11
+ static extractSelectValue($select: HTMLSelectElement): string | string[] | null | undefined;
11
12
  }
@@ -2,7 +2,7 @@ import { SELECT_RELATED_COMPONENTS_NAMES } from './components/select_components_
2
2
 
3
3
  class SelectControlUtils {
4
4
  static createHTMLOption(option) {
5
- const { selected, value, disabled, hidden, content } = option;
5
+ const { selected, value, disabled, hidden, content, isPlaceholder } = option;
6
6
  const $option = document.createElement(SELECT_RELATED_COMPONENTS_NAMES.option);
7
7
  $option.setAttribute('value', String(value));
8
8
  const $optionContent = document.createElement(SELECT_RELATED_COMPONENTS_NAMES.optionContent);
@@ -14,14 +14,17 @@ class SelectControlUtils {
14
14
  $option.setAttribute('disabled', '');
15
15
  if (hidden)
16
16
  $option.setAttribute('hidden', '');
17
+ if (isPlaceholder)
18
+ $option.setAttribute('placeholder', 'true');
17
19
  return $option;
18
20
  }
19
21
  static syncHTMLOptionWithModel(option, $option) {
20
- const { selected, value, disabled, hidden } = option;
22
+ const { selected, value, disabled, hidden, isPlaceholder } = option;
21
23
  $option.selected = selected;
22
24
  $option.value = value;
23
25
  $option.disabled = disabled;
24
26
  $option.hidden = hidden;
27
+ $option.toggleAttribute('placeholder', isPlaceholder);
25
28
  }
26
29
  static removeHTMLOptions($options, optionsValuesThatExists) {
27
30
  return $options.reduce((acc, $option) => {
@@ -46,6 +49,23 @@ class SelectControlUtils {
46
49
  const firstIndexInReversed = [...options].reverse().findIndex((option) => option.selected);
47
50
  return options.length - firstIndexInReversed - 1;
48
51
  }
52
+ static extractSelectValue($select) {
53
+ var _a;
54
+ const { selectedOptions } = $select;
55
+ const selectedValues = Array.from(selectedOptions).map((option) => option.value);
56
+ if (selectedValues.length === 0) {
57
+ return undefined;
58
+ }
59
+ const isPlaceholder = !$select.multiple && selectedOptions.length === 1 && ((_a = selectedOptions[0]) === null || _a === void 0 ? void 0 : _a.hasAttribute('placeholder'));
60
+ const isSingleEmptyValue = selectedValues.length === 1 && selectedValues[0] === '';
61
+ if (isPlaceholder && isSingleEmptyValue) {
62
+ return null;
63
+ }
64
+ if ($select.multiple) {
65
+ return selectedValues;
66
+ }
67
+ return selectedValues[0];
68
+ }
49
69
  }
50
70
 
51
71
  export { SelectControlUtils };
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -71,11 +71,6 @@ export { HAccordionGroup } from './components/accordion/accordion_group';
71
71
  export { HAccordionToggler } from './components/accordion/accordion_toggler';
72
72
  export { HAccordionContent } from './components/accordion/accordion_content';
73
73
  export * from './components/accordion/accordion_constants';
74
- export { HDetails } from './components/details/details';
75
- export { HDetailsGroup } from './components/details/details_group';
76
- export { HDetailsToggler } from './components/details/details_toggler';
77
- export { HDetailsContent } from './components/details/details_content';
78
- export * from './components/details/details_constants';
79
74
  export { BtnController } from './controllers/btn_controller/btn_controller';
80
75
  export { HDropdown } from './components/dropdown/dropdown';
81
76
  export { HDropdownToggler } from './components/dropdown/dropdown_toggler';
@@ -141,6 +136,7 @@ export { HSearchHistoryLoadMore } from './components/form/search/subcomponents/h
141
136
  export { HSearchSuggestionContent } from './components/form/search/subcomponents/results/search_suggestion_content';
142
137
  export { HSearchProductContent } from './components/form/search/subcomponents/results/search_product_content';
143
138
  export { HSearchProducerContent } from './components/form/search/subcomponents/results/search_producer_content';
139
+ export { SelectControlUtils } from './components/form/select/select_utils';
144
140
  export type { TSearchDisplayMode } from './components/form/search/search_types';
145
141
  export * from './components/form/search/search_constants';
146
142
  export { HToggle } from './components/toggle/toggle';
@@ -22,6 +22,7 @@ export { ToggleElementAriaController } from './controllers/toggle_element_aria_c
22
22
  export { HDropdownToggler } from './components/dropdown/dropdown_toggler.js';
23
23
  export { RelativePositionController } from './controllers/relative_position_controller/relative_position_controller.js';
24
24
  export { HDropdown } from './components/dropdown/dropdown.js';
25
+ export { SelectControlUtils } from './components/form/select/select_utils.js';
25
26
  export { HSelect } from './components/form/select/select.js';
26
27
  export { HFile } from './components/form/file_picker/file/file.js';
27
28
  export { INPUT_CONTROL_CSS_CLASSES, INPUT_CONTROL_EVENTS, INPUT_CONTROL_SIZES, INPUT_CONTROL_TYPES, INPUT_PROPS_TO_SYNC } from './components/form/input/input_constants.js';
@@ -75,11 +76,6 @@ export { HAccordion } from './components/accordion/accordion.js';
75
76
  export { HAccordionGroup } from './components/accordion/accordion_group.js';
76
77
  export { HAccordionContent } from './components/accordion/accordion_content.js';
77
78
  export { HAccordionToggler } from './components/accordion/accordion_toggler.js';
78
- export { DETAILS_CSS_CLASSES, DETAILS_EVENTS, DETAILS_TRANSITION_DURATION } from './components/details/details_constants.js';
79
- export { HDetails } from './components/details/details.js';
80
- export { HDetailsGroup } from './components/details/details_group.js';
81
- export { HDetailsToggler } from './components/details/details_toggler.js';
82
- export { HDetailsContent } from './components/details/details_content.js';
83
79
  export { HDropdownClose } from './components/dropdown/dropdown_close.js';
84
80
  export { HToggleButtonGroup } from './components/groups/toggle_button_group/toggle_button_group.js';
85
81
  export { HToggleButton } from './components/groups/toggle_button_group/toggle_button.js';
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@shoper/phoenix_design_system",
3
3
  "packageManager": "yarn@3.2.0",
4
4
  "sideEffects": false,
5
- "version": "1.18.8-9",
5
+ "version": "1.18.9",
6
6
  "description": "phoenix design system",
7
7
  "author": "zefirek",
8
8
  "license": "MIT",
@@ -31,7 +31,7 @@
31
31
  "@splidejs/splide-extension-auto-scroll": "0.5.3"
32
32
  },
33
33
  "devDependencies": {
34
- "@dreamcommerce/utilities": "^1.23.1",
34
+ "@dreamcommerce/utilities": "^1.23.1-3",
35
35
  "@shoper/jest_config": "^0.0.0",
36
36
  "@shoper/tsconfig": "^0.0.0",
37
37
  "@splidejs/splide": "4.0.7",
@@ -1,33 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var tslib_es6 = require('../../../../../external/tslib/tslib.es6.js');
6
- var decorators = require('lit/decorators');
7
- var phoenix_light_lit_element = require('../../core/phoenix_light_lit_element/phoenix_light_lit_element.js');
8
- var phoenix_custom_element = require('../../core/decorators/phoenix_custom_element.js');
9
- var accordion_constants = require('../accordion/accordion_constants.js');
10
- var details_constants = require('./details_constants.js');
11
-
12
- exports.HDetails = class HDetails extends phoenix_light_lit_element.PhoenixLightLitElement {
13
- constructor() {
14
- super(...arguments);
15
- this.disabled = false;
16
- this.mode = accordion_constants.ACCORDION_MODE.multi;
17
- }
18
- updated() {
19
- this.dispatchEvent(new Event(details_constants.DETAILS_EVENTS.update));
20
- }
21
- };
22
- tslib_es6.__decorate([
23
- decorators.property({ type: Boolean, reflect: true }),
24
- tslib_es6.__metadata("design:type", Object)
25
- ], exports.HDetails.prototype, "disabled", void 0);
26
- tslib_es6.__decorate([
27
- decorators.property({ type: String }),
28
- tslib_es6.__metadata("design:type", String)
29
- ], exports.HDetails.prototype, "mode", void 0);
30
- exports.HDetails = tslib_es6.__decorate([
31
- phoenix_custom_element.phoenixCustomElement('h-details')
32
- ], exports.HDetails);
33
- //# sourceMappingURL=details.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,20 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const DETAILS_EVENTS = {
6
- toggle: 'toggle',
7
- update: 'update'
8
- };
9
- const DETAILS_CSS_CLASSES = {
10
- smoothDetails: 'smooth-details',
11
- isOpen: 'is-open',
12
- contentWrapper: 'content-wrapper',
13
- content: 'content'
14
- };
15
- const DETAILS_TRANSITION_DURATION = 400;
16
-
17
- exports.DETAILS_CSS_CLASSES = DETAILS_CSS_CLASSES;
18
- exports.DETAILS_EVENTS = DETAILS_EVENTS;
19
- exports.DETAILS_TRANSITION_DURATION = DETAILS_TRANSITION_DURATION;
20
- //# sourceMappingURL=details_constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,23 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var tslib_es6 = require('../../../../../external/tslib/tslib.es6.js');
6
- var phoenix_light_lit_element = require('../../core/phoenix_light_lit_element/phoenix_light_lit_element.js');
7
- var phoenix_custom_element = require('../../core/decorators/phoenix_custom_element.js');
8
-
9
- exports.HDetailsContent = class HDetailsContent extends phoenix_light_lit_element.PhoenixLightLitElement {
10
- constructor() {
11
- super();
12
- this.slot = this.hasAttribute('slot') ? this.slot : 'content';
13
- }
14
- connectedCallback() {
15
- super.connectedCallback();
16
- this.classList.add('content-wrapper');
17
- }
18
- };
19
- exports.HDetailsContent = tslib_es6.__decorate([
20
- phoenix_custom_element.phoenixCustomElement('h-details-content'),
21
- tslib_es6.__metadata("design:paramtypes", [])
22
- ], exports.HDetailsContent);
23
- //# sourceMappingURL=details_content.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,125 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var tslib_es6 = require('../../../../../external/tslib/tslib.es6.js');
6
- var lit = require('lit');
7
- var decorators = require('lit/decorators');
8
- var phoenix_light_lit_element = require('../../core/phoenix_light_lit_element/phoenix_light_lit_element.js');
9
- var phoenix_custom_element = require('../../core/decorators/phoenix_custom_element.js');
10
- var accordion_constants = require('../accordion/accordion_constants.js');
11
- var details_constants = require('./details_constants.js');
12
-
13
- exports.HDetailsGroup = class HDetailsGroup extends phoenix_light_lit_element.PhoenixLightLitElement {
14
- constructor() {
15
- super(...arguments);
16
- this._$detailsWrapper = null;
17
- this._isDisabled = false;
18
- this._mode = accordion_constants.ACCORDION_MODE.multi;
19
- this._syncWithDetailsWrapper = () => {
20
- if (!this._$detailsWrapper)
21
- return;
22
- this._mode = this._$detailsWrapper.mode;
23
- this._isDisabled = this._$detailsWrapper.disabled;
24
- if (this._isDisabled) {
25
- this.disable();
26
- }
27
- else {
28
- this.enable();
29
- }
30
- };
31
- this._hideOtherDetailsGroups = () => {
32
- var _a;
33
- if (this._isDisabled)
34
- return;
35
- (_a = this._$detailsWrapper) === null || _a === void 0 ? void 0 : _a.querySelectorAll('h-details-group').forEach(($detailsGroup) => {
36
- if ($detailsGroup === this)
37
- return;
38
- $detailsGroup.hide();
39
- });
40
- };
41
- this._summaryClickHandler = (ev) => {
42
- ev.preventDefault();
43
- if (this._isDisabled)
44
- return;
45
- const $summary = ev.currentTarget;
46
- const $details = $summary.parentNode;
47
- this.toggle($details);
48
- };
49
- }
50
- connectedCallback() {
51
- var _a;
52
- super.connectedCallback();
53
- this._$detailsWrapper = this.closest('h-details');
54
- (_a = this._$detailsWrapper) === null || _a === void 0 ? void 0 : _a.addEventListener(details_constants.DETAILS_EVENTS.update, this._syncWithDetailsWrapper);
55
- this._syncWithDetailsWrapper();
56
- }
57
- toggle(details) {
58
- if (this._mode === accordion_constants.ACCORDION_MODE.single)
59
- this._hideOtherDetailsGroups();
60
- const $details = details || this.querySelector('details');
61
- if (!$details)
62
- return;
63
- const isOpen = $details.hasAttribute('open');
64
- isOpen ? this.hide($details) : this.show($details);
65
- }
66
- show(details) {
67
- if (this._mode === accordion_constants.ACCORDION_MODE.single)
68
- this._hideOtherDetailsGroups();
69
- const $details = details || this.querySelector('details');
70
- if (!$details)
71
- return;
72
- $details.setAttribute('open', '');
73
- requestAnimationFrame(() => {
74
- $details.classList.add(details_constants.DETAILS_CSS_CLASSES.isOpen);
75
- });
76
- this._dispatchToggleEvent($details, true);
77
- }
78
- hide(details) {
79
- const $details = details || this.querySelector('details');
80
- if (!$details)
81
- return;
82
- $details.classList.remove(details_constants.DETAILS_CSS_CLASSES.isOpen);
83
- setTimeout(() => {
84
- $details.removeAttribute('open');
85
- }, details_constants.DETAILS_TRANSITION_DURATION);
86
- this._dispatchToggleEvent($details, false);
87
- }
88
- _dispatchToggleEvent(details, open) {
89
- this.emitCustomEvent(details_constants.DETAILS_EVENTS.toggle, {
90
- detail: { open, target: details }
91
- });
92
- }
93
- enable() {
94
- if (this._isDisabled) {
95
- this.hide();
96
- this._isDisabled = false;
97
- }
98
- }
99
- disable() {
100
- if (!this._isDisabled) {
101
- this.show();
102
- this._isDisabled = true;
103
- }
104
- }
105
- render() {
106
- return lit.html `
107
- <details class="smooth-details">
108
- <summary @click=${this._summaryClickHandler}>${this.getSlot('toggler')}</summary>
109
- ${this.getSlot('content')}
110
- </details>
111
- `;
112
- }
113
- };
114
- tslib_es6.__decorate([
115
- decorators.state(),
116
- tslib_es6.__metadata("design:type", Object)
117
- ], exports.HDetailsGroup.prototype, "_isDisabled", void 0);
118
- tslib_es6.__decorate([
119
- decorators.state(),
120
- tslib_es6.__metadata("design:type", String)
121
- ], exports.HDetailsGroup.prototype, "_mode", void 0);
122
- exports.HDetailsGroup = tslib_es6.__decorate([
123
- phoenix_custom_element.phoenixCustomElement('h-details-group')
124
- ], exports.HDetailsGroup);
125
- //# sourceMappingURL=details_group.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,19 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var tslib_es6 = require('../../../../../external/tslib/tslib.es6.js');
6
- var phoenix_light_lit_element = require('../../core/phoenix_light_lit_element/phoenix_light_lit_element.js');
7
- var phoenix_custom_element = require('../../core/decorators/phoenix_custom_element.js');
8
-
9
- exports.HDetailsToggler = class HDetailsToggler extends phoenix_light_lit_element.PhoenixLightLitElement {
10
- constructor() {
11
- super();
12
- this.slot = this.hasAttribute('slot') ? this.slot : 'toggler';
13
- }
14
- };
15
- exports.HDetailsToggler = tslib_es6.__decorate([
16
- phoenix_custom_element.phoenixCustomElement('h-details-toggler'),
17
- tslib_es6.__metadata("design:paramtypes", [])
18
- ], exports.HDetailsToggler);
19
- //# sourceMappingURL=details_toggler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,8 +0,0 @@
1
- import { PhoenixLightLitElement } from "../../core/phoenix_light_lit_element/phoenix_light_lit_element";
2
- import './details_types';
3
- import type { TAccordionMode } from "../accordion/accordion_types";
4
- export declare class HDetails extends PhoenixLightLitElement {
5
- disabled: boolean;
6
- mode: TAccordionMode;
7
- updated(): void;
8
- }
@@ -1,31 +0,0 @@
1
- import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
2
- import { property } from 'lit/decorators';
3
- import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element/phoenix_light_lit_element.js';
4
- import { phoenixCustomElement } from '../../core/decorators/phoenix_custom_element.js';
5
- import { ACCORDION_MODE } from '../accordion/accordion_constants.js';
6
- import { DETAILS_EVENTS } from './details_constants.js';
7
-
8
- let HDetails = class HDetails extends PhoenixLightLitElement {
9
- constructor() {
10
- super(...arguments);
11
- this.disabled = false;
12
- this.mode = ACCORDION_MODE.multi;
13
- }
14
- updated() {
15
- this.dispatchEvent(new Event(DETAILS_EVENTS.update));
16
- }
17
- };
18
- __decorate([
19
- property({ type: Boolean, reflect: true }),
20
- __metadata("design:type", Object)
21
- ], HDetails.prototype, "disabled", void 0);
22
- __decorate([
23
- property({ type: String }),
24
- __metadata("design:type", String)
25
- ], HDetails.prototype, "mode", void 0);
26
- HDetails = __decorate([
27
- phoenixCustomElement('h-details')
28
- ], HDetails);
29
-
30
- export { HDetails };
31
- //# sourceMappingURL=details.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,4CAAgD;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,11 +0,0 @@
1
- export declare const DETAILS_EVENTS: {
2
- readonly toggle: "toggle";
3
- readonly update: "update";
4
- };
5
- export declare const DETAILS_CSS_CLASSES: {
6
- readonly smoothDetails: "smooth-details";
7
- readonly isOpen: "is-open";
8
- readonly contentWrapper: "content-wrapper";
9
- readonly content: "content";
10
- };
11
- export declare const DETAILS_TRANSITION_DURATION = 400;